コード例 #1
0
 public InvasionViewModel(Invasion invasion, FiltersEvent filtersEvent, IItemStore itemStore)
 {
     this.invasion = invasion;
     Id            = invasion.Id;
     isDefenderFactionInfestation = invasion.DefenderMissionInfo.Faction == "FC_INFESTATION";
     AttackerFaction = FactionViewModel.ById(invasion.AttackerMissionInfo.Faction);
     DefenderFaction = FactionViewModel.ById(invasion.DefenderMissionInfo.Faction);
     Faction         = FactionViewModel.ById(invasion.Faction);
     Sector          = SectorViewModel.FromSector(invasion.Node);
     LocTag          = Model.Filters.ExpandMission(invasion.LocTag)?.Name ?? invasion.LocTag;
     DefenderReward  = new InvasionRewardViewModel(invasion.DefenderReward, itemStore);
     AttackerReward  = new InvasionRewardViewModel(invasion.AttackerReward, itemStore);
     Update();
     SectorsUpdatedWeakEventManager.AddHandler(filtersEvent, OnSectorsFilterUpdated);
     MissionsUpdatedWeakEventManager.AddHandler(filtersEvent, OnMissionsFilterUpdated);
 }
コード例 #2
0
 private void OnSectorsFilterUpdated(object sender, EventArgs eventArgs) =>
 Sector = SectorViewModel.FromSector(invasion.Node);