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); }
static void UpdateToUnknown(FactionViewModel vm, string name) => vm.UpdateTo(name, Brushes.Black, new EllipseGeometry(new System.Windows.Point(), 1, 1));