#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member

using System;
using System.Collections.Generic;
using System.Linq;

using Volpe.Cafe.MarketData.BaselineInfo;
using Volpe.Cafe.MarketData.Design;

namespace Volpe.Cafe.MarketData
{
    /// <summary>
    /// Represents an engine family that encapsulates a description of its engineering characteristics as well as
    /// provides an annual historic view of its revisions.
    /// </summary>
    /// <seealso cref="BaselineComponentFamily"/>
    /// <seealso cref="Engine"/>
    [Serializable]
    public class EngineFamily : OEMComponentFamily<IEngine>, IEngineFamily
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="EngineFamily"/> class, using the specified baseline info.
        /// </summary>
        /// <param name="baselineInfo">
        ///     A description of baseline (or initial) configuration for this <see cref="EngineFamily"/>.
        /// </param>
        public EngineFamily(BaselineComponentFamily baselineInfo) : base(baselineInfo) { }

        public override int[] TechnologyList => TechnologyIndexes.EngineLevel;

        protected override List<IEngine> FindComponentFamilyComponents()
        {
            return this.Industry.FindEnginesByFamilyName(this.FamilyName);
        }

        protected override List<IVehicle> FindComponentFamilyVehicles()
        {
            var components = this.FindComponentFamilyComponents();
            return components.SelectMany(item => this.Industry.FindVehiclesByEngineCode(item.Code)).ToList();
        }

    }
}
