Ejemplo n.º 1
0
 private void playAgainstButtons_Click(object sender, EventArgs e)
 {
     if (sender == playAgainstComButton)
     {
         m_GameType = Player.PlayerTypes.COMPUTER;
     }
     else if (sender == playAgainstFriendButton)
     {
         m_GameType = Player.PlayerTypes.PLAYER;
     }
     this.DialogResult = DialogResult.OK;
     this.Close();
 }
Ejemplo n.º 2
0
        // Constructor

        public Game(int i_BoardSize, Player.PlayerTypes i_GameType)
        {
            m_Board      = new Tile[i_BoardSize, i_BoardSize];
            m_Players[0] = new Player(Colors.RED, Player.PlayerTypes.PLAYER);
            m_Players[1] = new Player(Colors.YELLOW, i_GameType);

            for (int row = 0; row < BoardSize; row++)
            {
                for (int col = 0; col < BoardSize; col++)
                {
                    m_Board[row, col] = new Tile(row, col);
                }
            }
        }