コード例 #1
0
        public static double GetAirSuperiorityPotential(this PresetShipModel ship, AirSuperiorityCalculationOptions option)
        {
            var slots = new PresetShipData(ship).Ship.RawData.api_maxeq;

            return(ship.Slots
                   .Select((x, y) =>
            {
                var calc = new PresetSlotData(x).Item?.Type.GetCalculator() ?? EmptyCalculator.Instance;

                if (slots[y] <= 0)
                {
                    return 0;
                }
                if (!option.HasFlag(calc.Options))
                {
                    return 0;
                }

                return calc.GetAirSuperiority(x, slots[y], option);
            })
                   .Sum());
        }
コード例 #2
0
 public void Deserialize(string Data)
 => this.Source = PresetShipModel.Deserialize(Data);
コード例 #3
0
 public PresetShipData(PresetShipModel ship)
 {
     this.Source = ship;
 }