示例#1
0
        public void CopyUnit(GameUserInfo gameUserInfo)
        {
            Unit result = new Unit(gameUserInfo, this.UnitType1, this.Terrain1);

            result.FirstId   = this.FirstId;
            result.IsWounded = this.IsWounded;
        }
示例#2
0
        public UsedHomeCard(GameUserInfo gameUserInfo, HomeCardType homeCardType)
        {
            this.GameUserInfo = gameUserInfo;

            this.Step          = gameUserInfo.Step;
            this.Game          = gameUserInfo.Game;
            this.HomeCardType  = homeCardType.Name;
            this.HomeCardType1 = homeCardType;

            gameUserInfo.UsedHomeCard.Add(this);
        }
示例#3
0
        public void CopyGameUserTerrain(GameUserInfo gameUserInfo)
        {
            GameUserTerrain result = new GameUserTerrain();

            result.GameUserInfo = gameUserInfo;

            result.Id       = Guid.NewGuid();
            result.Step     = gameUserInfo.Step;
            result.Game     = gameUserInfo.Game;
            result.Terrain  = this.Terrain;
            result.Terrain1 = this.Terrain1;

            gameUserInfo.GameUserTerrain.Add(result);
        }
示例#4
0
        public void CopyPowerCounter(GameUserInfo gameUserInfo)
        {
            PowerCounter result = new PowerCounter();

            result.GameUserInfo = gameUserInfo;
            result.Terrain1     = this.Terrain1;

            result.Id        = Guid.NewGuid();
            result.Step      = gameUserInfo.Step;
            result.Game      = gameUserInfo.Game;
            result.TokenType = this.TokenType;
            result.Terrain   = this.Terrain;

            gameUserInfo.PowerCounter.Add(result);
        }
示例#5
0
        public Unit(GameUserInfo gameUserInfo, UnitType type, Terrain terrain)
        {
            this.Id      = Guid.NewGuid();
            this.FirstId = this.Id;
            this.Step    = gameUserInfo.Step;
            this.Game    = gameUserInfo.Game;

            this.UnitType  = type.Name;
            this.UnitType1 = type;
            this.Terrain   = terrain.Name;
            this.Terrain1  = terrain;

            this.GameUserInfo = gameUserInfo;
            gameUserInfo.Unit.Add(this);
        }
示例#6
0
        public void CopyOrder(GameUserInfo gameUserInfo)
        {
            Order result = new Order();

            result.GameUserInfo = gameUserInfo;
            result.Terrain1     = this.Terrain1;
            result.OrderType1   = this.OrderType1;

            result.Id        = Guid.NewGuid();
            result.Step      = gameUserInfo.Step;
            result.Game      = gameUserInfo.Game;
            result.FirstId   = this.FirstId;
            result.OrderType = this.OrderType;
            result.Terrain   = this.Terrain;

            gameUserInfo.Order.Add(result);
        }
示例#7
0
        public UsedHomeCard(GameUserInfo gameUserInfo, HomeCardType homeCardType)
        {
            if (gameUserInfo.Step1.GameUser1.HomeType != homeCardType.HomeType ||
                gameUserInfo.UsedHomeCard.Any(p => p.HomeCardType == homeCardType.Name))
            {
                return;
            }

            this.GameUserInfo = gameUserInfo;

            this.Step          = gameUserInfo.Step;
            this.Game          = gameUserInfo.Game;
            this.HomeCardType  = homeCardType.Name;
            this.HomeCardType1 = homeCardType;

            gameUserInfo.UsedHomeCard.Add(this);
        }
示例#8
0
        public void СollectConsolidate(GameUser collectUser)
        {
            //если приказ свой
            if (this.GameUserInfo.Step1 == collectUser.LastStep)
            {
                int powerCount = this.Terrain1.ConsolidatePower(collectUser.Game1) + 1;
                GameUserInfo.ChangePower(powerCount);
                collectUser.LastStep.NewMessage(string.Format("dynamic_consolidatePower*terrain_{0}*{1}", this.Terrain, GameUserInfo.Power));
                this.GameUserInfo.Order.Remove(this);
            }
            else
            {
                collectUser.LastStep.GameUserInfo.ChangePower(1);
                collectUser.LastStep.NewMessage(string.Format("dynamic_consolidatePower*terrain_{0}*{1}", this.Terrain, GameUserInfo.Power));

                Step newStep = this.GameUserInfo.Step1.CopyStep("Default", true);
                newStep.GameUserInfo.ChangePower(-1);
                newStep.NewMessage(string.Format("dynamic_consolidatePowerLoses*terrain_{0}*{1}", this.Terrain, GameUserInfo.Power));
                newStep.GameUserInfo.Order.Remove(newStep.GameUserInfo.Order.Single(p => p.FirstId == this.FirstId));
            }
        }
示例#9
0
        public void CopyGameUserInfo(Step step)
        {
            GameUserInfo result = new GameUserInfo
            {
                Step1 = step,

                Step            = step.Id,
                Game            = step.Game,
                Power           = this.Power,
                Supply          = this.Supply,
                ThroneInfluence = this.ThroneInfluence,
                BladeInfluence  = this.BladeInfluence,
                RavenInfluence  = this.RavenInfluence,
                IsBladeUse      = this.IsBladeUse
            };

            foreach (GameUserTerrain item in this.GameUserTerrain.ToList())
            {
                item.CopyGameUserTerrain(result);
            }
            foreach (PowerCounter item in this.PowerCounter.ToList())
            {
                item.CopyPowerCounter(result);
            }
            foreach (Unit item in this.Unit.ToList())
            {
                item.CopyUnit(result);
            }
            foreach (Order item in this.Order.ToList())
            {
                item.CopyOrder(result);
            }
            foreach (UsedHomeCard item in this.UsedHomeCard.ToList())
            {
                item.CopyUsedHomeCard(result);
            }

            step.GameUserInfo = result;
        }
示例#10
0
        public void CopyGameUserInfo(Step step)
        {
            GameUserInfo result = new GameUserInfo();

            result.Step1 = step;

            result.Step            = step.Id;
            result.Game            = step.Game;
            result.Power           = this.Power;
            result.Supply          = this.Supply;
            result.ThroneInfluence = this.ThroneInfluence;
            result.BladeInfluence  = this.BladeInfluence;
            result.RavenInfluence  = this.RavenInfluence;
            result.IsBladeUse      = this.IsBladeUse;

            foreach (var item in this.GameUserTerrain.ToList())
            {
                item.CopyGameUserTerrain(result);
            }
            foreach (var item in this.PowerCounter.ToList())
            {
                item.CopyPowerCounter(result);
            }
            foreach (var item in this.Unit.ToList())
            {
                item.CopyUnit(result);
            }
            foreach (var item in this.Order.ToList())
            {
                item.CopyOrder(result);
            }
            foreach (var item in this.UsedHomeCard.ToList())
            {
                item.CopyUsedHomeCard(result);
            }

            step.GameUserInfo = result;
        }
示例#11
0
 internal void CopyUsedHomeCard(GameUserInfo gameUserInfo)
 {
     new UsedHomeCard(gameUserInfo, this.HomeCardType1);
 }