Skip to content

Commit

Permalink
Merge pull request Grabacr07#109 from Grabacr07/fix-calc-airsuperiori…
Browse files Browse the repository at this point in the history
…ty-target-fleet

制空値計算を第一艦隊のみ対象とするよう修正
  • Loading branch information
Grabacr07 committed Feb 19, 2016
2 parents bc21b9c + 9d37ebc commit 7a1d2d6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source/Grabacr07.KanColleWrapper/Models/FleetState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7a1d2d6

Please sign in to comment.