From 9d37ebc13500082e74ed469d64ee83126c20d936 Mon Sep 17 00:00:00 2001 From: veigr Date: Thu, 18 Feb 2016 18:36:31 +0900 Subject: [PATCH] =?UTF-8?q?=E5=88=B6=E7=A9=BA=E5=80=A4=E8=A8=88=E7=AE=97?= =?UTF-8?q?=E3=82=92=E7=AC=AC=E4=B8=80=E8=89=A6=E9=9A=8A=E3=81=AE=E3=81=BF?= =?UTF-8?q?=E5=AF=BE=E8=B1=A1=E3=81=A8=E3=81=99=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/Grabacr07.KanColleWrapper/Models/FleetState.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/Grabacr07.KanColleWrapper/Models/FleetState.cs b/source/Grabacr07.KanColleWrapper/Models/FleetState.cs index d9d8cb560..018c2d715 100644 --- a/source/Grabacr07.KanColleWrapper/Models/FleetState.cs +++ b/source/Grabacr07.KanColleWrapper/Models/FleetState.cs @@ -251,12 +251,13 @@ public FleetState(Homeport homeport, params Fleet[] fleets) public void Calculate() { var ships = this.source.SelectMany(x => x.Ships).WithoutEvacuated().ToArray(); + var firstFleetShips = this.source.FirstOrDefault()?.Ships.WithoutEvacuated().ToArray() ?? new Ship[0]; this.TotalLevel = ships.HasItems() ? ships.Sum(x => x.Level) : 0; this.AverageLevel = ships.HasItems() ? (double)this.TotalLevel / ships.Length : 0.0; - this.AirSuperiorityPotential = ships.Sum(s => s.CalcAirSuperiorityPotential()); - this.MinAirSuperiorityPotential = ships.Sum(s => s.CalcMinAirSuperiorityPotential()); - this.MaxAirSuperiorityPotential = ships.Sum(s => s.CalcMaxAirSuperiorityPotential()); + this.AirSuperiorityPotential = firstFleetShips.Sum(s => s.CalcAirSuperiorityPotential()); + this.MinAirSuperiorityPotential = firstFleetShips.Sum(s => s.CalcMinAirSuperiorityPotential()); + this.MaxAirSuperiorityPotential = firstFleetShips.Sum(s => s.CalcMaxAirSuperiorityPotential()); this.Speed = ships.All(x => x.Info.Speed == ShipSpeed.Fast) ? FleetSpeed.Fast : ships.All(x => x.Info.Speed == ShipSpeed.Low)