internal void Calculate()
{
var ships = this.source.SelectMany(x => x.Ships).WithoutEvacuated().ToArray();
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.Speed = ships.All(x => x.Info.Speed == ShipSpeed.Fast)
? FleetSpeed.Fast
: ships.All(x => x.Info.Speed == ShipSpeed.Low)
? FleetSpeed.Low
: FleetSpeed.Hybrid;
var logic = ViewRangeCalcLogic.Get(KanColleClient.Current.Settings.ViewRangeCalcType);
this.ViewRange = logic.Calc(ships.ToArray());
this.ViewRangeCalcType = logic.Name;
if (this.Calculated != null)
{
this.Calculated(this, new EventArgs());
}
}