private void exitGame() { if (InvalidMove != null) { EndOfGame.Invoke(getOppositionPlayer(), EventArgs.Empty); } }
private void FireGameOverIfNeeded() { if (NumberOfSticks == 0) { gameStage = GameStage.GameOver; EndOfGame.Invoke(WhoseTurn); } }
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); }