Пример #1
0
        public void TestPlayerChange()
        {
            var playerQueue = new PlayerQueue();
            var player = playerQueue.Current;

            //Has the player changed?
            playerQueue.ChangePlayer();
            var newPlayer = playerQueue.Current;
            Assert.AreNotSame(newPlayer, player);

            //Are we back to the first player?
            playerQueue.ChangePlayer();
            newPlayer = playerQueue.Current;
            Assert.AreSame(newPlayer, player);
        }
Пример #2
0
        private void CreateGame()
        {
            Black = new Player(Token.Black);
            White = new Player(Token.White);

            var queue = new PlayerQueue(Black, White);
            Queue = queue;

            Game = new RevGame(Queue);
            SnapshotContainer = Game.SnapshotContainer;
            SnapshotContainer.SetInitialState(new OnePartTurn() { Board = Game.CloneBoard(), PlayerThatPlayed = White, PlayerToPlay = Black });

            RaisePropertyChanged(() => Game);
            RaisePropertyChanged(() => SnapshotContainer);
        }