private void initControls() { GameBoardUI.e_BoardSize i_BoardSize = m_FormNameLogin.BoardSizeSelection; string player1Name = m_FormNameLogin.Player1Name; string player2Name = m_FormNameLogin.Player2Name; int boardSizeAsInt = (int)i_BoardSize; Player Player1 = new Player(player1Name, boardSizeAsInt, 1, false); Player Player2 = new Player(player2Name, boardSizeAsInt, 2, !m_FormNameLogin.ComputerOrNot); Player1.InitAllTheCheckersOfOnePlayer(boardSizeAsInt, Player.e_LocationOfThePlayer.UP); Player2.InitAllTheCheckersOfOnePlayer(boardSizeAsInt, Player.e_LocationOfThePlayer.DOWN); m_Game = new Game(Player1, Player2, boardSizeAsInt); m_Board = new GameBoardUI(i_BoardSize); locateBoardOnTheForm(boardSizeAsInt); startGame(m_Game); }
private void InitControls() { GameBoardUI.e_BoardSize i_BoardSize = m_FormNameLogin.BoardSizeSelection; string player1Name = m_FormNameLogin.Player1Name; string player2Name = m_FormNameLogin.Player2Name; Player Player1 = new Player(player1Name, (int)i_BoardSize, 1, false); Player Player2 = new Player(player2Name, (int)i_BoardSize, 2, false); Player1.InitAllTheCheckersOfOnePlayer((int)i_BoardSize, Player.e_LocationOfThePlayer.DOWN); Player2.InitAllTheCheckersOfOnePlayer((int)i_BoardSize, Player.e_LocationOfThePlayer.UP); Game = new Game(Player1, Player2, (int)i_BoardSize); m_Board = new GameBoardUI(i_BoardSize); initCheckers(Player1, Player2, Game); for (int i = 0; i < (int)i_BoardSize; i++) { for (int j = 0; j < (int)i_BoardSize; j++) { m_Board.GetBoard[i, j].Size = new Size(60, 60); m_Board.GetBoard[i, j].Location = new Point((i) * 60, (j + 1) * 60); this.Controls.Add(m_Board.GetBoard[i, j]); } } }