コード例 #1
0
ファイル: ArmyFightCM.cs プロジェクト: AciesNN/cyc
		public ArmyFightCM() { } //JSON Constructor

		public ArmyFightCM(ArmyFightCM armyFight) 
		{
			this.AttackIslandID = armyFight.AttackIslandID;
			this.AttackCount = armyFight.AttackCount;
			this.AttackPlayerID = armyFight.AttackPlayerID;
			this.AttackRetreateAvalible = armyFight.AttackRetreateAvalible;

			this.DefenceIslandID = armyFight.DefenceIslandID;
			this.DefenceCount = armyFight.DefenceCount;
			this.DefencePlayerID = armyFight.DefencePlayerID;
			this.DefenceFortressCount = armyFight.DefenceFortressCount;
			this.DefenceRetreateAvalible = armyFight.DefenceRetreateAvalible;
			this.IsMinotaurus = armyFight.IsMinotaurus;
		}
コード例 #2
0
ファイル: MoveArmy.cs プロジェクト: AciesNN/cyc
		protected override UnitOfWork GetUnitOfWorkImpl(Context context)
		{
			int deffencePlayerID = context.map.Islands[islandToID].OwnerID;
			int defenceCount = context.map.GetArmyCountByIsland(islandToID, deffencePlayerID);
			bool isMinotaurus = context.map.IsThereCreatureOnIsland(Card.Minotaur, islandToID);

			//TODO minotaurus?
			if (deffencePlayerID == playerID || defenceCount == 0 && !isMinotaurus)
			{
				UnitOfWork uow= new UOW_Move()
				{
					playerID = playerID,
					islandFromID = islandFromID,
					islandToID = islandToID,
					count = count,
					gold = gold,
					pegasus = IsPegusus,

					changeOwner = (deffencePlayerID != playerID)
				};
				return uow;
			}
			else
			{
				ArmyFightCM armyFight = new ArmyFightCM()
					{
						AttackIslandID = islandFromID,
						AttackCount = count,
						AttackPlayerID = playerID,
						AttackRetreateAvalible = context.map.CanPlayerRetreatFromIsland(islandToID, playerID),

						DefenceIslandID = islandToID,
						DefenceCount = defenceCount,
						DefencePlayerID = deffencePlayerID,
						DefenceFortressCount = context.map.GetBuildCountAtIsland(islandToID, Build.Mars, true),
						DefenceRetreateAvalible = context.map.CanPlayerRetreatFromIsland(islandToID, deffencePlayerID),
						IsMinotaurus = isMinotaurus
					};

				UnitOfWork uow = new UOW_Fight()
				{
					playerID = playerID,
					islandFromID = islandFromID,
					islandToID = islandToID,
					count = count,
					gold = gold,
					pegasus = IsPegusus,

					armyFight = armyFight
				};
				return uow;
			}
		}
コード例 #3
0
ファイル: Context.cs プロジェクト: AciesNN/cyc
		internal void DestroyArmyFight()
		{
			armyFight = null;

			if (OnDestroyArmyFight != null)
				OnDestroyNavyFight();
		}
コード例 #4
0
ファイル: Context.cs プロジェクト: AciesNN/cyc
		internal void CreateArmyFight(ArmyFightCM copy)
		{
			armyFight = new ArmyFightCM(copy);

			if (OnCreateArmyFight!= null)
				OnCreateArmyFight();
		}