public void RunGame() { SetButtonClick(); GameForm gameForm = new GameForm(m_StartGame.Board,m_PictureBoxClick); FirstRound(gameForm); while (m_StartGame.statusGame == statusGame.Going) { Round(gameForm); } ShowStatusAfterRunning(); }
public void Round(GameForm i_GameForm) { i_GameForm.SizeBoard = m_StartGame.BoardSize; i_GameForm.StartGameFrom(); bool haveMoves = m_StartGame.HaveMoves(); while ((!haveMoves) && (m_StartGame.FirstPlayer.HaveMoves == true || m_StartGame.SecondPlayer.HaveMoves == true)) { switchPlayersTurn(); haveMoves = m_StartGame.HaveMoves(); } if (!(m_StartGame.FirstPlayer.HaveMoves == true || m_StartGame.SecondPlayer.HaveMoves == true)) { m_StartGame.UpdateGameStatus(); } playerColor playerColorTurn = m_StartGame.GetPlayerTurn(); i_GameForm.ChangeTitle(playerColorTurn); i_GameForm.SetGameFrom(); i_GameForm.Refresh(); }
public GameControl(Game i_Game) { m_StartGame = i_Game; m_GameForm = new GameForm(m_StartGame.Board, m_PictureBoxClick); m_GameForm.SizeBoard = m_StartGame.BoardSize; }