Interface GameManager<T extends Game<?,?,?,?,?,?,?,?,?>>


@NonExtendable public interface GameManager<T extends Game<?,?,?,?,?,?,?,?,?>>
  • Method Details

    • getGame

      Optional<T> getGame(String name)
      Parameters:
      name - Name of game or string representation of an uuid
      Returns:
      Optional with game or empty if game does not exist
      See Also:
    • getGame

      Optional<T> getGame(UUID uuid)
      Parameters:
      uuid - Unique id of the game
      Returns:
      Optional with the game or empty if the game does not exist
    • getGames

      List<T> getGames()
      Returns:
      List of available games
    • getGameNames

      List<String> getGameNames()
      Returns:
      List of names of all game
    • hasGame

      boolean hasGame(String name)
      Parameters:
      name - Name of game or string representation of an uuid
      Returns:
      true if the game exists
    • hasGame

      boolean hasGame(UUID uuid)
      Parameters:
      uuid - Unique id of the game
      Returns:
      true if the game exists
    • getGameWithHighestPlayers

      Optional<T> getGameWithHighestPlayers()
      Returns:
      Free game that has the highest players in it or empty optional
    • getGameWithLowestPlayers

      Optional<T> getGameWithLowestPlayers()
      Returns:
      Free game that has the lowest players in it or empty optional
    • getFirstWaitingGame

      Optional<T> getFirstWaitingGame()
      Returns:
      Game in waiting state or empty optional
    • getFirstRunningGame

      Optional<T> getFirstRunningGame()
      Returns:
      Game in running state or empty optional