private void initializePlayer1(GameSettingsForm i_GameSettingsForm) { string userName = i_GameSettingsForm.Player1Name; m_Player1 = new Player(userName, 0, Cell.eCellSign.PawnX, Cell.eCellSign.KingX) { Turn = true }; }
private void play(GameSettingsForm i_GameSettingsForm) { initializePlayer1(i_GameSettingsForm); initializePlayer2(i_GameSettingsForm); initializeBoard(i_GameSettingsForm.Dimension); distributePawnsToPlayers(m_GameBoard.Dimension); m_MyChecker = new Checker(m_GameBoard); m_MyChecker.OnClick += ButtonClicked; OnAnotherRound += anotherRoundClicked; m_MyChecker.Player1Label.Text = m_Player1.Name; m_MyChecker.Player2Label.Text = m_Player2.Name; m_MyChecker.ShowDialog(); }
private void initializePlayer2(GameSettingsForm i_GameSettingsForm) { string userName; ePlayerType opponent = i_GameSettingsForm.AskOpponent; if (opponent == ePlayerType.Human) { userName = i_GameSettingsForm.Player2Name; } else { userName = "******"; } m_Player2 = new Player(userName, 0, Cell.eCellSign.PawnO, Cell.eCellSign.KingO) { Turn = false }; }
public GameManager(GameSettingsForm i_GameSettingsForm) { m_Move = new Move(); r_RandomGenerator = new Random(); play(i_GameSettingsForm); }
public static void Main() { GameSettingsForm gameSettings = new GameSettingsForm(); gameSettings.ShowDialog(); }