Interface GameResult<P>

Type Parameters:
P - the player type (platform-specific)

public interface GameResult<P>
Represents the result of a finished game.

This interface provides information about the outcome of a game, including the winner, podium positions, all participating players, and whether the game was cancelled.

  • Method Summary

    Modifier and Type
    Method
    Description
    Gets all players who participated in the game.
    Gets the reason why the game was cancelled.
    Gets the top 3 players (podium) of the game.
    Gets the winner of the game.
    boolean
    Checks if the game has a winner.
    boolean
    Checks if the game was cancelled before completion.
  • Method Details

    • getWinner

      P getWinner()
      Gets the winner of the game.
      Returns:
      the winning player, or null if there is no winner
    • getPodium

      List<P> getPodium()
      Gets the top 3 players (podium) of the game.
      Returns:
      a list containing the top 3 players in order
    • getAllPlayers

      List<P> getAllPlayers()
      Gets all players who participated in the game.
      Returns:
      a list of all players who were in the game
    • hasWinner

      boolean hasWinner()
      Checks if the game has a winner.
      Returns:
      true if there is a winner, false otherwise
    • wasCancelled

      boolean wasCancelled()
      Checks if the game was cancelled before completion.
      Returns:
      true if the game was cancelled, false otherwise
    • getCancelReason

      String getCancelReason()
      Gets the reason why the game was cancelled.
      Returns:
      the cancellation reason, or null if the game was not cancelled