Ejemplo n.º 1
0
 public void RemovePlayerFromBoard(String token)
 {
     foreach (Territory territory in game.Board.Territories)
     {
         if (territory.Owner == game.GetPlayer(token))
         {
             territory.Owner  = null;
             territory.Armies = 0;
         }
     }
 }
Ejemplo n.º 2
0
        public void RemovePlayerAfterXFailedContactAttemps()
        {
            bool isPlayerOnBoard = true;

            game.TryPlaceArmy(player1Token, new Location(0, 0));
            game.TryPlaceArmy(player2Token, new Location(1, 0));
            gameRunner.BootPlayerFromGame(game.GetPlayer(player1Token) as ApiPlayer);

            Assert.AreEqual(1, game.Players.Count());

            foreach (Territory territory in game.Board.Territories)
            {
                if (territory.Owner != null && territory.Owner.Token != player1Token)
                {
                    isPlayerOnBoard = false;
                }
            }
            Assert.IsFalse(isPlayerOnBoard);
        }
        public void PlayerHasAtLeastOnePlaceToAttack()
        {
            var actual = testgame.PlayerCanAttack(testgame.GetPlayer(player2Token));

            actual.Should().BeTrue();
        }