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

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

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

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

    }
}
