Ejemplo n.º 1
0
        private void UserControl_Drop(object sender, DragEventArgs e)
        {
            ExtGameUserInfo gameUserInfo = (e.Data.GetData(typeof(ExtGameUserInfo)) as ExtGameUserInfo);

            if (_GameUserInfo.Step.Game.ClientStep.WCFStep.Voting.Target != "Железный_трон" ||
                gameUserInfo == null || _GameUserInfo.ThroneVoting != gameUserInfo.ThroneVoting)
            {
                App.Agot2.errorView.ShowByDispatcher(App.GetResources("text_notify"), App.GetResources("validation_power"));
                return;
            }

            int curentThroneInfluence = _GameUserInfo.WCFGameUserInfo.ThroneInfluence;
            int dropThroneInfluence   = gameUserInfo.WCFGameUserInfo.ThroneInfluence;

            _GameUserInfo.WCFGameUserInfo.ThroneInfluence = dropThroneInfluence;
            gameUserInfo.WCFGameUserInfo.ThroneInfluence  = curentThroneInfluence;
            _GameUserInfo.OnPropertyChanged("ThronePosition");
            gameUserInfo.OnPropertyChanged("ThronePosition");

            StringBuilder sb = new StringBuilder();

            foreach (var item in _GameUserInfo.Step.Game.ViewGameUserInfo.OrderBy(p => p.WCFGameUserInfo.ThroneInfluence))
            {
                sb.Append(item.Step.ExtGameUser.WCFGameUser.HomeType);
                sb.Append('|');
            }

            _GameUserInfo.Step.Game.ClientStep.WCFStep.Raven.StepType = sb.ToString();
        }
Ejemplo n.º 2
0
        public ExtStep(WCFStep wcfStep, ExtGame game)
        {
            WCFStep     = wcfStep;
            Game        = game;
            ExtGameUser = game.ExtGameUser.Single(p => p.WCFGameUser.Id == WCFStep.GameUser);

            if (wcfStep.GameUserInfo != null)
            {
                ExtGameUserInfo = new ExtGameUserInfo(this, wcfStep.GameUserInfo);
            }

            if (wcfStep.GameInfo != null)
            {
                ExtGameInfo = new ExtGameInfo(this, wcfStep.GameInfo);
            }

            if (wcfStep.Support != null)
            {
                ExtSupport = new ExtSupport(this, wcfStep.Support);
            }

            if (wcfStep.BattleUser != null)
            {
                ExtBattleUser = new ExtBattleUser(this, wcfStep.BattleUser);
            }

            if (wcfStep.March != null)
            {
                ExtMarch = new ExtMarch(this, wcfStep.March);
            }

            if (wcfStep.StepType == "Замысел")
            {
                Game.OnNewPlanningPhase();
            }
        }
Ejemplo n.º 3
0
        void ExtGame_CurrentViewKeyCgange()
        {
            ExtGameUserInfo extGameUserInfo = Game.ViewGameUserInfo.LastOrDefault(p => p.TerrainCol.Any(p1 => p1 == this));

            this.ExtHolderUser = extGameUserInfo == null ? null : extGameUserInfo.Step.ExtGameUser;
        }
Ejemplo n.º 4
0
 void TrackViewItem_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
 {
     _GameUserInfo = (ExtGameUserInfo)DataContext;
 }