Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Yavalath.Game"/> class.
        /// </summary>
        /// <param name='player1'>
        /// Player1.
        /// </param>
        /// <param name='player2'>
        /// Player2.
        /// </param>
        public Game(Player player1, Player player2)
        {
            GameBoard = new Board();
            Players = new Dictionary<Player, int>(){
                {player1, -1},
                {player2, 1}
            };

            CurrentPlayer = player1;
        }
Exemple #2
0
 /// <summary>
 /// Selects the next the player.
 /// </summary>
 private void NextPlayer()
 {
     var next = Players.Where(p => p.Value != Players[CurrentPlayer]).Select(p => p.Key).First();
     CurrentPlayer = next;
 }