showDialogOnGameOver method

Future<bool> showDialogOnGameOver(
  1. ChessBoardInterface game
)

returns if game is over (isReset)

Implementation

Future<bool> showDialogOnGameOver(ChessBoardInterface game) async {
  GameOverBy? gameOverBy = checkForGameEnd(game);

  if (gameOverBy != null) {
    if (onGameOver != null) {
      onGameOver!(gameOverBy);
    } else if (showDialogs) {
      return await _defaultGameOverDialog(game, gameOverBy);
    }
  }

  return false;
}