Ejemplo n.º 1
0
        public void ShouldAddPlayers()
        {
            var newPlayer1 = Substitute.For <IPlayer>();
            var newPlayer2 = Substitute.For <IPlayer>();

            Assert.AreEqual(PlayerRoundStatus.NotPlaying, _playerTurnController.GetPlayerRoundStatus(newPlayer1));
            Assert.AreEqual(PlayerRoundStatus.NotPlaying, _playerTurnController.GetPlayerRoundStatus(newPlayer2));
            _playerTurnController.AddPlayers(new List <IPlayer> {
                newPlayer1, newPlayer2
            });
            Assert.AreEqual(PlayerRoundStatus.PendingToPlay, _playerTurnController.GetPlayerRoundStatus(newPlayer1));
            Assert.AreEqual(PlayerRoundStatus.PendingToPlay, _playerTurnController.GetPlayerRoundStatus(newPlayer2));
        }
Ejemplo n.º 2
0
        public GameStateController(GameState <T> gameState, IList <IPlayer> players)
        {
            //shuffle before assigning round order
            players.Shuffle();

            PlayerTurnController = new PlayerTurnController();
            PlayerTurnController.AddPlayers(players);

            gameState.OnStateUpdated += OnStateUpdated;
            GameState = gameState;
        }