#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 a transmission 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="Transmission"/>
    [Serializable]
    public class TransmissionFamily : OEMComponentFamily<ITransmission>, ITransmissionFamily
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="TransmissionFamily"/> class, using the specified baseline
        /// info.
        /// </summary>
        /// <param name="baselineInfo">
        ///     A description of baseline (or initial) configuration for this <see cref="TransmissionFamily"/>.
        /// </param>
        public TransmissionFamily(BaselineComponentFamily baselineInfo) : base(baselineInfo) { }

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

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

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

    }
}
