static private IEnumerable <string> Convert(ExtStep model) { var items = model.WCFStep.Message.Select(p => App.TextDecoder(p)).Reverse().ToList(); model.WCFStep.Message = items; return(model.WCFStep.Message); }
public ExtVesterosAction(ExtStep step, WCFVesterosAction wcfVesterosAction) { Step = step; WCFVesterosAction = wcfVesterosAction; ExtVesterosDecks = Step.Game.ViewGameInfo.ExtVesterosDecks.Single(p => p.WCFVesterosDecks.Id == WCFVesterosAction.VesterosDecks); }
private void ExtGame_ClientStepCgange(ExtStep newValue) { if (newValue == null) { this.SupportVisibility = Visibility.Collapsed; } }
public string RavenVoting => $"{Step.Game.GetUserLastVoting(Step.ExtGameUser, "Королевский_двор").Value?.WCFStep.Voting.PowerCount ?? 0}"; //|{Step.ExtGameUserInfo.WCFGameUserInfo.Power}"; public ExtGameUserInfo(ExtStep step, WCFGameUserInfo wcfGameUserInfo) { Step = step; WCFGameUserInfo = wcfGameUserInfo; ExtUnit = WCFGameUserInfo.Unit. Select(p => new ExtUnit(step, p)) .ToList(); ExtPowerCounter = WCFGameUserInfo.PowerCounter. Select(p => new ExtPowerCounter(step, p)) .ToList(); ExtOrder = wcfGameUserInfo.Order. Select(p => new ExtOrder(step, p)) .ToList(); TerrainCol = wcfGameUserInfo.GameUserTerrain. Select(p => p.ExtTerrain()); VictoryPosition = GetVictoryPosition(); SupplyPosition = GetSupplyPosition(); //if (Step.WCFStep.Voting != null) //{ // switch (Step.WCFStep.Voting.Target) // { // case "Железный_трон": ThroneVoting = Step.WCFStep.Voting.PowerCount.ToString(); break; // case "Вотчины": BladeVoting = Step.WCFStep.Voting.PowerCount.ToString(); break; // case "Королевский_двор": RavenVoting = Step.WCFStep.Voting.PowerCount.ToString(); break; // } //} }
public ExtMarchUnit(ExtStep step, WCFMarchUnit wcfMarchUnit) { Step = step; WCFMarchUnit = wcfMarchUnit; ExtUnit = Step.Game.ViewUnit.Single(p => p.WCFUnit.Id == WCFMarchUnit.Unit); }
void ExtGame_ClientStepCgange(ExtStep newValue) { if (newValue != null) { switch (newValue.WCFStep.StepType) { case "Посыльный_ворон": if (this.WCFSymbolic.Name == "Посыльный_ворон" || this.WCFSymbolic.Name == "Карта_одичалых") { Background = _DefaultBackground; this.Visibility = Visibility.Visible; return; } break; case "dragon_Ser_Gerris_Drinkwater": case "Доран_Мартелл": if (this.WCFSymbolic.Name != "Карта_одичалых") { Background = _DefaultBackground; this.Visibility = Visibility.Visible; return; } break; case "Король-за-Стеной": if (newValue.WCFStep.Raven.StepType == "First") { if (this.WCFSymbolic.Name != "Карта_одичалых") { Background = _DefaultBackground; this.Visibility = Visibility.Visible; return; } } else { if (this.WCFSymbolic.Name != "Карта_одичалых" && this.WCFSymbolic.Name != "Железный_трон") { Background = _DefaultBackground; this.Visibility = Visibility.Visible; return; } } break; case "Передовой_отряд": if (newValue.WCFStep.Raven.StepType.Contains(this.WCFSymbolic.Name)) { Background = _DefaultBackground; this.Visibility = Visibility.Visible; return; } break; } } ExtGame_CurrentViewKeyCganged(); }
public ExtSupport(ExtStep step, WCFSupport wcfSupport) { Step = step; WCFSupport = wcfSupport; User = step.ExtGameUser; UpdateView(); }
public ExtMarch(ExtStep step, WCFMarch wcfMarch) { Step = step; WCFMarch = wcfMarch; //каждый раз запрашивает новый список ExtMarchUnit = WCFMarch.MarchUnit.Select(p => new ExtMarchUnit(Step, p)); }
public ExtUnit(ExtStep step, WCFUnit wcfUnit) { Step = step; WCFUnit = wcfUnit; ExtTerrain = MainWindow.ClientInfo.WorldData.Terrain.Single(p => p.WCFTerrain.Name == WCFUnit.Terrain); ExtUnitType = MainWindow.ClientInfo.WorldData.UnitType.Single(p => p.WCFUnitType.Name == WCFUnit.UnitType); }
public ExtBattle(ExtStep step, WCFBattle wcfBattle) { Step = step; WCFBattle = wcfBattle; AttackUser = Step.Game.ExtGameUser.Single(p => p.WCFGameUser.Id == WCFBattle.AttackUser); DefenceUser = Step.Game.ExtGameUser.Single(p => p.WCFGameUser.Id == WCFBattle.DefenceUser); AttackTerrain = MainWindow.ClientInfo.WorldData.Terrain.Single(p => p.WCFTerrain.Name == wcfBattle.AttackTerrain); DefenceTerrain = MainWindow.ClientInfo.WorldData.Terrain.Single(p => p.WCFTerrain.Name == wcfBattle.DefenceTerrain); }
public ExtPowerCounter(ExtStep step, WCFPowerCounter wcfPowerCounter) { Step = step; WCFPowerCounter = wcfPowerCounter; ExtTerrain = MainWindow.ClientInfo.WorldData.Terrain.Single(p => p.WCFTerrain.Name == WCFPowerCounter.Terrain); ImageName = Step.ExtGameUser.ExtHomeType.ImageName; Position = ExtTerrain.ExtTokenPoint .Single(p => p.WCFTokenPoint.TokenType == "Жетон_власти") .WCFGamePoint; }
public ExtVesterosDecks(ExtStep step, WCFVesterosDecks wcfVesterosDecks) { Step = step; WCFVesterosDecks = wcfVesterosDecks; WCFVesterosCardType = MainWindow.ClientInfo.WorldData.WCFStaticData.VesterosCardType.Single(p => p.Id == WCFVesterosDecks.VesterosCardType); ImageName = App.GetResources("image_" + WCFVesterosDecks.VesterosCardType); Name = App.GetResources("event_" + WCFVesterosDecks.VesterosCardType); ActionVisibility = Visibility.Collapsed; Step.Game.ClientStepCganged += Game_ClientStepCganged; }
private void ExtGame_ClientStepCgange(ExtStep step) { if (step == null) { StepTimer.Stop(); } else { StepTimer.Start(step); } }
private void Game_ClientStepCganged(ExtStep clientStep) { if (clientStep != null && clientStep.WCFStep.StepType == "dragon_Rodrik_the_Reader" && string.IsNullOrEmpty(clientStep.WCFStep.BattleUser.AdditionalEffect)) { ExloreView = Visibility.Visible; } else { ExloreView = Visibility.Collapsed; } }
public ExtBattleUser(ExtStep step, WCFBattleUser wcfBattleUser) { WCFBattleUser = wcfBattleUser; Step = step; ExtHomeCardType = string.IsNullOrEmpty(WCFBattleUser.HomeCardType) ? null : MainWindow.ClientInfo.WorldData.HomeCardType.Single(p => p.WCFHomeCardType.Name == WCFBattleUser.HomeCardType); Strength = WCFBattleUser.Strength.HasValue ? WCFBattleUser.Strength.Value.ToString() : "?"; RandomCard = WCFBattleUser.RandomDeskId.HasValue ? ExtRandomDesk.GetRandomDesk(WCFBattleUser.RandomDeskId.Value) : null; }
public ExtOrder(ExtStep step, WCFOrder wcfOrder) { Step = step; WCFOrder = wcfOrder; ExtTerrain = MainWindow.ClientInfo.WorldData.Terrain.Single(p => p.WCFTerrain.Name == WCFOrder.Terrain); Position = this.ExtTerrain.ExtTokenPoint.Single(p => p.WCFTokenPoint.TokenType == "Приказ").WCFGamePoint; Step.Game.CurrentViewKeyCganged += ExtGame_CurrentViewKeyCgange; Step.Game.SelecteOrderChanged += ExtOrder_SelectedOrderChange; ClientInfo.ClientGameChanging += ClientInfo_ClientGameChanging; }
private void Game_ClientStepCganged(ExtStep step) { if (step == null || step.WCFStep.StepType != "Событие_Вестероса" || step.WCFStep.VesterosAction.VesterosDecks != WCFVesterosDecks.Id) { ActionVisibility = Visibility.Collapsed; } else { ActionVisibility = Visibility.Visible; } OnPropertyChanged("ActionVisibility"); }
private void ExtGame_ClientStepCganged(ExtStep step) { ClientStep = step; if (ClientStep != null && ClientStep.WCFStep.StepType == "dragon_Rodrik_the_Reader" && !string.IsNullOrEmpty(ClientStep.WCFStep.BattleUser.AdditionalEffect)) { var cards = JsonConvert.DeserializeObject <List <string> >(ClientStep.WCFStep.BattleUser.AdditionalEffect); ViewModels = cards.Select(p => new ViewModel() { path = App.GetResources("image_" + p), id = p }).ToList(); ExloreView = Visibility.Visible; } else { ExloreView = Visibility.Collapsed; } }
public ExtGameInfo(ExtStep step, WCFGameInfo wcfGameInfo) { Step = step; WCFGameInfo = wcfGameInfo; if (wcfGameInfo.Battle != null) { ExtBattle = new ExtBattle(Step, wcfGameInfo.Battle); } ExtGarrison = wcfGameInfo.Garrison .Select(p => new ExtGarrison(p)) .ToList(); ExtVesterosDecks = wcfGameInfo.VesterosDecks .Select(p => new ExtVesterosDecks(Step, p)) .OrderBy(p => p.WCFVesterosDecks.Sort) .ToList(); TurnPosition = MainWindow.ClientInfo.WorldData.TrackPoint. Single(p => p.WCFTrackPoint.TrackType == "Раунд" && p.WCFTrackPoint.Value == WCFGameInfo.Turn). GamePoint; BarbarianPosition = MainWindow.ClientInfo.WorldData.TrackPoint. Single(p => p.WCFTrackPoint.TrackType == "Одичалые" && p.WCFTrackPoint.Value == WCFGameInfo.Barbarian). GamePoint; RavenOverlayPosition = MainWindow.ClientInfo.WorldData.TrackPoint. Single(p => p.WCFTrackPoint.TrackType == "Королевский_двор" && p.WCFTrackPoint.Value == 1). GamePoint; if (Step.Game.ViewGameInfo != null && Step.Game.ViewGameInfo.WCFGameInfo.Turn != wcfGameInfo.Turn) { Step.Game.OnNewWesterosPhase(); } }
private void ExtGame_ClientStepCganged(ExtStep step) { stepName.Visibility = step == null ? Visibility.Collapsed : Visibility.Visible; }
private void ExtGame_ClientStepCganged(ExtStep step) { ClientStep = step; }
private void OnClientStepCganged(ExtStep newValue) { ClientStepCganged?.Invoke(newValue); }
public LogItemViewModel(ExtStep model) : base(Convert(model)) { Step = model; }