Interface ZentrixGameType


public interface ZentrixGameType
Represents a read-only view of a game type configuration.

Game types define different modes of play (e.g., Solos, Duos, Squads) with their own team sizes, player limits, and scoreboards.

Example Usage


 GameTypeService service = ZentrixAPI.get().getGameTypeService();

 Optional<ZentrixGameType> gameType = service.getGameType("trios");
 gameType.ifPresent(gt -> {
     System.out.println("Game Type: " + gt.getName());
     System.out.println("Team Size: " + gt.getTeamSize());
     System.out.println("Players: " + gt.getMinimumPlayers() + "-" + gt.getMaximumPlayers());
 });
 
Since:
1.1.0
  • Method Details

    • getName

      @NotNull @NotNull String getName()
      Gets the name of this game type.

      This is the unique identifier used in configuration and selection.

      Returns:
      The game type name (never null)
    • getTeamSize

      int getTeamSize()
      Gets the team size for this game type.

      For Solos, this is 1. For Duos, 2. For Squads, typically 4.

      Returns:
      The team size
    • getMinimumPlayers

      int getMinimumPlayers()
      Gets the minimum number of players required to start a game.
      Returns:
      The minimum player count
    • getMaximumPlayers

      int getMaximumPlayers()
      Gets the maximum number of players allowed in a game.
      Returns:
      The maximum player count
    • getStartTime

      int getStartTime()
      Gets the start time countdown duration in seconds.

      This is how long players wait after minimum players are reached before the game starts.

      Returns:
      The start time in seconds
    • hasScoreboards

      boolean hasScoreboards()
      Checks if this game type has any scoreboards configured.
      Returns:
      true if at least one state has a scoreboard
    • hasScoreboardForState

      boolean hasScoreboardForState(@NotNull @NotNull ZentrixGameType.GameTypeState state)
      Checks if a specific game state has a scoreboard configured.
      Parameters:
      state - The game state to check
      Returns:
      true if a scoreboard is configured for that state
    • getScoreboardTitle

      @NotNull @NotNull Optional<String> getScoreboardTitle(@NotNull @NotNull ZentrixGameType.GameTypeState state)
      Gets the scoreboard title for a specific game state.
      Parameters:
      state - The game state
      Returns:
      Optional containing the title, or empty if no scoreboard for that state
    • getScoreboardLines

      @NotNull @NotNull List<String> getScoreboardLines(@NotNull @NotNull ZentrixGameType.GameTypeState state)
      Gets the scoreboard lines for a specific game state.
      Parameters:
      state - The game state
      Returns:
      An unmodifiable list of lines (never null, may be empty)
    • getAddonId

      @NotNull @NotNull Optional<String> getAddonId()
      Gets the addon ID that registered this game type.
      Returns:
      Optional containing the addon ID, or empty if not addon-registered
    • isDynamicallyRegistered

      boolean isDynamicallyRegistered()
      Checks if this game type was dynamically registered by an addon.

      Built-in game types (from configuration) return false.

      Returns:
      true if dynamically registered
    • isBuiltIn

      default boolean isBuiltIn()
      Checks if this is a built-in game type from the configuration.
      Returns:
      true if this is a built-in type
    • getCustomFields

      @NotNull @NotNull Map<String,Object> getCustomFields()
      Gets custom metadata fields for this game type.
      Returns:
      An unmodifiable map of custom fields (never null, may be empty)