Record Class CustomGameInfo

java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.customgame.CustomGameInfo
Record Components:
id - the custom game's stable ID
hostId - the host
hostName - the host's name when they published it
gameTypeName - the game type it is played as
sourceArenaName - the arena its worlds are built from
addonSource - whether an addon's arena source supplied that arena
scenarioIds - the scenarios it runs, in order
state - where it is in its life
scheduledAt - when its match starts, in epoch milliseconds
publishedAt - when it was published, in epoch milliseconds
passwordProtected - whether players need a password to join
joinable - whether players may join right now
playerCount - how many players are in its lobby or match now
remainingCapacity - how many more players fit
runtimeId - the runtime ID of its lobby or match while one exists, or null

public record CustomGameInfo(@NotNull UUID id, @NotNull UUID hostId, @NotNull String hostName, @NotNull String gameTypeName, @NotNull String sourceArenaName, boolean addonSource, @NotNull List<String> scenarioIds, @NotNull CustomGameState state, long scheduledAt, long publishedAt, boolean passwordProtected, boolean joinable, int playerCount, int remainingCapacity, @Nullable String runtimeId) extends Record
A player-hosted custom game, read at one moment. A snapshot: it does not follow later changes.

Everything the host decided is frozen at publication. A password-protected game reports only that it is protected; the password itself is never exposed.

Since:
1.8.0
  • Constructor Details

    • CustomGameInfo

      public CustomGameInfo(@NotNull @NotNull UUID id, @NotNull @NotNull UUID hostId, @NotNull @NotNull String hostName, @NotNull @NotNull String gameTypeName, @NotNull @NotNull String sourceArenaName, boolean addonSource, @NotNull @NotNull List<String> scenarioIds, @NotNull @NotNull CustomGameState state, long scheduledAt, long publishedAt, boolean passwordProtected, boolean joinable, int playerCount, int remainingCapacity, @Nullable @Nullable String runtimeId)
      Creates an instance of a CustomGameInfo record class.
      Parameters:
      id - the value for the id record component
      hostId - the value for the hostId record component
      hostName - the value for the hostName record component
      gameTypeName - the value for the gameTypeName record component
      sourceArenaName - the value for the sourceArenaName record component
      addonSource - the value for the addonSource record component
      scenarioIds - the value for the scenarioIds record component
      state - the value for the state record component
      scheduledAt - the value for the scheduledAt record component
      publishedAt - the value for the publishedAt record component
      passwordProtected - the value for the passwordProtected record component
      joinable - the value for the joinable record component
      playerCount - the value for the playerCount record component
      remainingCapacity - the value for the remainingCapacity record component
      runtimeId - the value for the runtimeId record component
  • Method Details

    • getRuntimeId

      @NotNull public @NotNull Optional<String> getRuntimeId()
      The runtime ID of its lobby or match, while one exists.
    • millisUntilStart

      public long millisUntilStart()
      Milliseconds until its match starts as of this snapshot, never negative.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      @NotNull public @NotNull UUID id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • hostId

      @NotNull public @NotNull UUID hostId()
      Returns the value of the hostId record component.
      Returns:
      the value of the hostId record component
    • hostName

      @NotNull public @NotNull String hostName()
      Returns the value of the hostName record component.
      Returns:
      the value of the hostName record component
    • gameTypeName

      @NotNull public @NotNull String gameTypeName()
      Returns the value of the gameTypeName record component.
      Returns:
      the value of the gameTypeName record component
    • sourceArenaName

      @NotNull public @NotNull String sourceArenaName()
      Returns the value of the sourceArenaName record component.
      Returns:
      the value of the sourceArenaName record component
    • addonSource

      public boolean addonSource()
      Returns the value of the addonSource record component.
      Returns:
      the value of the addonSource record component
    • scenarioIds

      @NotNull public @NotNull List<String> scenarioIds()
      Returns the value of the scenarioIds record component.
      Returns:
      the value of the scenarioIds record component
    • state

      @NotNull public @NotNull CustomGameState state()
      Returns the value of the state record component.
      Returns:
      the value of the state record component
    • scheduledAt

      public long scheduledAt()
      Returns the value of the scheduledAt record component.
      Returns:
      the value of the scheduledAt record component
    • publishedAt

      public long publishedAt()
      Returns the value of the publishedAt record component.
      Returns:
      the value of the publishedAt record component
    • passwordProtected

      public boolean passwordProtected()
      Returns the value of the passwordProtected record component.
      Returns:
      the value of the passwordProtected record component
    • joinable

      public boolean joinable()
      Returns the value of the joinable record component.
      Returns:
      the value of the joinable record component
    • playerCount

      public int playerCount()
      Returns the value of the playerCount record component.
      Returns:
      the value of the playerCount record component
    • remainingCapacity

      public int remainingCapacity()
      Returns the value of the remainingCapacity record component.
      Returns:
      the value of the remainingCapacity record component
    • runtimeId

      @Nullable public @Nullable String runtimeId()
      Returns the value of the runtimeId record component.
      Returns:
      the value of the runtimeId record component