public void Update(Nation nation, WarSide ws) { if (ws != null) { Set(ref _sideName, ws.Name, "SideName"); Set(ref _mainBrush, ws.MainBrush, "MainBrush"); Set(ref _puppetBrush, ws.PuppetBrush, "PuppetBrush"); Set(ref _occupiedBrush, ws.OccupiedBrush, "OccupiedBrush"); Set(ref _gainBrush, ws.GainBrush, "GainBrush"); } else { Brush neutralBrush = new SolidColorBrush(Windows.UI.Color.FromArgb(0xff, nation.MainColor.R, nation.MainColor.G, nation.MainColor.B)); Set(ref _sideName, "Neutral", "SideName"); Set(ref _mainBrush, neutralBrush, "MainBrush"); Set(ref _puppetBrush, neutralBrush, "PuppetBrush"); Set(ref _occupiedBrush, neutralBrush, "OccupiedBrush"); Set(ref _gainBrush, neutralBrush, "GainBrush"); } }
public MapDisplayEntry(Nation nation, WarSide ws, MainViewModel viewModelReference) { this.Nation = nation; if (ws != null) { SideName = ws.Name; MainBrush = ws.MainBrush; PuppetBrush = ws.PuppetBrush; OccupiedBrush = ws.OccupiedBrush; GainBrush = ws.GainBrush; } else { Brush neutralBrush = new SolidColorBrush(Windows.UI.Color.FromArgb(0xff, nation.MainColor.R, nation.MainColor.G, nation.MainColor.B)); SideName = "Neutral"; MainBrush = neutralBrush; PuppetBrush = neutralBrush; OccupiedBrush = neutralBrush; GainBrush = neutralBrush; } }