Ejemplo n.º 1
0
 public void RunGame()
 {
     SetButtonClick();
     GameForm gameForm = new GameForm(m_StartGame.Board,m_PictureBoxClick);
     FirstRound(gameForm);
     while (m_StartGame.statusGame == statusGame.Going)
     {
         Round(gameForm);
     }
     ShowStatusAfterRunning();
 }
Ejemplo n.º 2
0
 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();
 }
Ejemplo n.º 3
0
 public GameControl(Game i_Game)
 {
     m_StartGame = i_Game;
     m_GameForm = new GameForm(m_StartGame.Board, m_PictureBoxClick);
     m_GameForm.SizeBoard = m_StartGame.BoardSize;
 }