Esempio n. 1
0
 private void exitGame()
 {
     if (InvalidMove != null)
     {
         EndOfGame.Invoke(getOppositionPlayer(), EventArgs.Empty);
     }
 }
Esempio n. 2
0
 private void FireGameOverIfNeeded()
 {
     if (NumberOfSticks == 0)
     {
         gameStage = GameStage.GameOver;
         EndOfGame.Invoke(WhoseTurn);
     }
 }
Esempio n. 3
0
        public bool GameOver()
        {
            bool gameOver = false;

            if (CurrentPlayer.IsLoose() || WaitingPlayer.Tie(CurrentPlayer))
            {
                gameOver = !gameOver;  // true
                CalcFinalScore();
                EndOfGameEventArgs e = new EndOfGameEventArgs();
                EndOfGame.Invoke(this, e);

                if (!e.m_GameOver)
                {
                    PlayerHasScored.Invoke(this, new EventArgs());
                    Checkers.Board.ClearLogicBoard();
                    ResetGame();
                }
            }

            return(gameOver);
        }