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
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumEnum representing game states for scoreboard selection. -
Method Summary
Modifier and TypeMethodDescriptionGets the addon ID that registered this game type.Gets custom metadata fields for this game type.intGets the maximum number of players allowed in a game.intGets the minimum number of players required to start a game.@NotNull StringgetName()Gets the name of this game type.getScoreboardLines(@NotNull ZentrixGameType.GameTypeState state) Gets the scoreboard lines for a specific game state.getScoreboardTitle(@NotNull ZentrixGameType.GameTypeState state) Gets the scoreboard title for a specific game state.intGets the start time countdown duration in seconds.intGets the team size for this game type.booleanhasScoreboardForState(@NotNull ZentrixGameType.GameTypeState state) Checks if a specific game state has a scoreboard configured.booleanChecks if this game type has any scoreboards configured.default booleanChecks if this is a built-in game type from the configuration.booleanChecks if this game type was dynamically registered by an addon.
-
Method Details
-
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:
trueif at least one state has a scoreboard
-
hasScoreboardForState
Checks if a specific game state has a scoreboard configured.- Parameters:
state- The game state to check- Returns:
trueif 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
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:
trueif dynamically registered
-
isBuiltIn
default boolean isBuiltIn()Checks if this is a built-in game type from the configuration.- Returns:
trueif this is a built-in type
-
getCustomFields
Gets custom metadata fields for this game type.- Returns:
- An unmodifiable map of custom fields (never null, may be empty)
-