public void GameOver() { EndResult end = new EndResult(ResultAddvertisement(player, robot1, robot2, robot3)); if (end.ShowDialog() == DialogResult.OK) { m_BoardGameForm.Close(); Application.Exit(); } }
public void RobotTurns() { //robot 1 turn if (robot1.PlayerNumber == m_BoardGameForm.CurrentTurn && robot1.CanNotRollForXTurn == 0 && robot1.Loser == false) { CurrentRobotPlayHisTurn(robot1); m_CalculateNextPlayer.GetTheNextPlayersTurnStartingWithRobot2(); } else if (robot1.PlayerNumber == m_BoardGameForm.CurrentTurn && robot1.Loser == true) { m_CalculateNextPlayer.GetTheNextPlayersTurnStartingWithRobot2(); } System.Threading.Thread.Sleep(200); //robot 2 turn if (robot2.PlayerNumber == m_BoardGameForm.CurrentTurn && robot2.CanNotRollForXTurn == 0 && robot2.Loser == false) { CurrentRobotPlayHisTurn(robot2); m_CalculateNextPlayer.GetTheNextPlayersTurnStartingWithRobot3(); } else if (robot2.PlayerNumber == m_BoardGameForm.CurrentTurn && robot2.Loser == true) { m_CalculateNextPlayer.GetTheNextPlayersTurnStartingWithRobot3(); } System.Threading.Thread.Sleep(200); //robot 3 turn if (robot3.PlayerNumber == m_BoardGameForm.CurrentTurn && robot3.CanNotRollForXTurn == 0 && robot3.Loser == false) { CurrentRobotPlayHisTurn(robot3); m_CalculateNextPlayer.GetTheNextPlayersTurnStartingWithThePlayer(); } else if (robot3.PlayerNumber == m_BoardGameForm.CurrentTurn && robot3.Loser == true) { m_CalculateNextPlayer.GetTheNextPlayersTurnStartingWithThePlayer(); } System.Threading.Thread.Sleep(200); if (m_BoardGameForm.CurrentTurn > 0) { RobotTurns(); } if (robot1.Loser && robot2.Loser && robot3.Loser) { MessageBox.Show("Gratulálok te nyertél!"); m_BoardGameForm.Close(); Application.Exit(); } }