예제 #1
0
        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);
        }
예제 #2
0
        public ExtVesterosAction(ExtStep step, WCFVesterosAction wcfVesterosAction)
        {
            Step = step;
            WCFVesterosAction = wcfVesterosAction;

            ExtVesterosDecks = Step.Game.ViewGameInfo.ExtVesterosDecks.Single(p => p.WCFVesterosDecks.Id == WCFVesterosAction.VesterosDecks);
        }
예제 #3
0
 private void ExtGame_ClientStepCgange(ExtStep newValue)
 {
     if (newValue == null)
     {
         this.SupportVisibility = Visibility.Collapsed;
     }
 }
예제 #4
0
        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;
            //    }
            //}
        }
예제 #5
0
        public ExtMarchUnit(ExtStep step, WCFMarchUnit wcfMarchUnit)
        {
            Step         = step;
            WCFMarchUnit = wcfMarchUnit;

            ExtUnit = Step.Game.ViewUnit.Single(p => p.WCFUnit.Id == WCFMarchUnit.Unit);
        }
예제 #6
0
        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();
        }
예제 #7
0
        public ExtSupport(ExtStep step, WCFSupport wcfSupport)
        {
            Step       = step;
            WCFSupport = wcfSupport;
            User       = step.ExtGameUser;

            UpdateView();
        }
예제 #8
0
        public ExtMarch(ExtStep step, WCFMarch wcfMarch)
        {
            Step     = step;
            WCFMarch = wcfMarch;

            //каждый раз запрашивает новый список
            ExtMarchUnit = WCFMarch.MarchUnit.Select(p => new ExtMarchUnit(Step, p));
        }
예제 #9
0
        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);
        }
예제 #10
0
        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);
        }
예제 #11
0
        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;
        }
예제 #12
0
        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;
        }
예제 #13
0
 private void ExtGame_ClientStepCgange(ExtStep step)
 {
     if (step == null)
     {
         StepTimer.Stop();
     }
     else
     {
         StepTimer.Start(step);
     }
 }
예제 #14
0
 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;
     }
 }
예제 #15
0
        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;
        }
예제 #16
0
        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;
        }
예제 #17
0
        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");
        }
예제 #18
0
        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;
            }
        }
예제 #19
0
        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();
            }
        }
예제 #20
0
 private void ExtGame_ClientStepCganged(ExtStep step)
 {
     stepName.Visibility = step == null ? Visibility.Collapsed : Visibility.Visible;
 }
 private void ExtGame_ClientStepCganged(ExtStep step)
 {
     ClientStep = step;
 }
예제 #22
0
 private void OnClientStepCganged(ExtStep newValue)
 {
     ClientStepCganged?.Invoke(newValue);
 }
예제 #23
0
 public LogItemViewModel(ExtStep model)
     : base(Convert(model))
 {
     Step = model;
 }