internal BattleInfo() { r_Current = this; var rFleets = KanColleGame.Current.Port.Fleets; if (rFleets.CombinedFleetType == 0) Participants.FriendMain = KanColleGame.Current.Sortie.Fleet.Ships.Select(r => new FriendShip(r)).ToList<IParticipant>(); else { Participants.FriendMain = rFleets[1].Ships.Select(r => new FriendShip(r)).ToList<IParticipant>().AsReadOnly(); Participants.FriendEscort = rFleets[2].Ships.Select(r => new FriendShip(r)).ToList<IParticipant>().AsReadOnly(); } CurrentStage = new FakeStage(this); OnPropertyChanged(nameof(CurrentStage)); }
internal BattleInfo(long rpTimestamp, RawMapExploration rpData) { Current = this; ID = rpTimestamp; var rSortie = SortieInfo.Current; Participants.FriendMain = rSortie.MainShips; Participants.FriendEscort = rSortie.EscortShips; foreach (FriendShip rShip in rSortie.MainShips) { rShip.Reset(); } if (rSortie.EscortShips != null) { foreach (FriendShip rShip in rSortie.EscortShips) { rShip.Reset(); } } CurrentStage = new FakeStage(this); OnPropertyChanged(nameof(CurrentStage)); IsBossBattle = rpData.NodeEventType == SortieEventType.BossBattle; if ((BattleType)rpData.NodeEventSubType == BattleType.Normal) { var rSupportFleets = KanColleGame.Current.Port.Fleets .Where(r => r.ExpeditionStatus.Expedition != null && !r.ExpeditionStatus.Expedition.CanReturn) .Select(r => r.ExpeditionStatus.Expedition) .SingleOrDefault(r => r.MapArea.ID == rSortie.Map.MasterInfo.AreaID && r.Time == (!IsBossBattle ? 15 : 30)); IsSupportFleetReady = rSupportFleets != null; } if (rSortie.LandBaseAerialSupportRequests != null) { var rNodeUniqueID = MapService.Instance.GetNodeUniqueID(rSortie.Map.ID, rpData.Node); if (rNodeUniqueID.HasValue && Array.IndexOf(rSortie.LandBaseAerialSupportRequests, rNodeUniqueID.Value) != -1) { IsLandBaseAerialSupportReady = true; } } }
internal BattleInfo(RawMapExploration rpData) { Current = this; var rSortie = SortieInfo.Current; Participants.FriendMain = rSortie.MainShips; Participants.FriendEscort = rSortie.EscortShips; foreach (FriendShip rShip in rSortie.MainShips) rShip.IsMVP = false; if (rSortie.EscortShips != null) foreach (FriendShip rShip in rSortie.EscortShips) rShip.IsMVP = false; CurrentStage = new FakeStage(this); OnPropertyChanged(nameof(CurrentStage)); IsBossBattle = rpData.NodeEventType == SortieEventType.BossBattle; if ((BattleType)rpData.NodeEventSubType == BattleType.Normal) { var rSupportFleets = KanColleGame.Current.Port.Fleets.Table.Values .Where(r => r.ExpeditionStatus.Expedition != null && !r.ExpeditionStatus.Expedition.CanReturn) .Select(r => r.ExpeditionStatus.Expedition) .SingleOrDefault(r => r.MapArea.ID == rSortie.Map.ID / 10 && r.Time == (!IsBossBattle ? 15 : 30)); IsSupportFleetReady = rSupportFleets != null; } if (rSortie.LandBaseAerialSupportRequests != null) { var rNodeUniqueID = MapService.Instance.GetNodeUniqueID(rSortie.Map.ID, rpData.Node); if (rNodeUniqueID.HasValue && rSortie.LandBaseAerialSupportRequests.Any(r => r == rNodeUniqueID.Value)) IsLandBaseAerialSupportReady = true; } }