Record Class CustomGameInfo
java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.customgame.CustomGameInfo
- Record Components:
id- the custom game's stable IDhostId- the hosthostName- the host's name when they published itgameTypeName- the game type it is played assourceArenaName- the arena its worlds are built fromaddonSource- whether an addon's arena source supplied that arenascenarioIds- the scenarios it runs, in orderstate- where it is in its lifescheduledAt- when its match starts, in epoch millisecondspublishedAt- when it was published, in epoch millisecondspasswordProtected- whether players need a password to joinjoinable- whether players may join right nowplayerCount- how many players are in its lobby or match nowremainingCapacity- how many more players fitruntimeId- 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 Summary
ConstructorsConstructorDescriptionCustomGameInfo(@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) Creates an instance of aCustomGameInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theaddonSourcerecord component.final booleanIndicates whether some other object is "equal to" this one.@NotNull StringReturns the value of thegameTypeNamerecord component.The runtime ID of its lobby or match, while one exists.final inthashCode()Returns a hash code value for this object.@NotNull UUIDhostId()Returns the value of thehostIdrecord component.@NotNull StringhostName()Returns the value of thehostNamerecord component.@NotNull UUIDid()Returns the value of theidrecord component.booleanjoinable()Returns the value of thejoinablerecord component.longMilliseconds until its match starts as of this snapshot, never negative.booleanReturns the value of thepasswordProtectedrecord component.intReturns the value of theplayerCountrecord component.longReturns the value of thepublishedAtrecord component.intReturns the value of theremainingCapacityrecord component.@Nullable StringReturns the value of theruntimeIdrecord component.Returns the value of thescenarioIdsrecord component.longReturns the value of thescheduledAtrecord component.@NotNull StringReturns the value of thesourceArenaNamerecord component.@NotNull CustomGameStatestate()Returns the value of thestaterecord component.final StringtoString()Returns a string representation of this record class.
-
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 aCustomGameInforecord class.- Parameters:
id- the value for theidrecord componenthostId- the value for thehostIdrecord componenthostName- the value for thehostNamerecord componentgameTypeName- the value for thegameTypeNamerecord componentsourceArenaName- the value for thesourceArenaNamerecord componentaddonSource- the value for theaddonSourcerecord componentscenarioIds- the value for thescenarioIdsrecord componentstate- the value for thestaterecord componentscheduledAt- the value for thescheduledAtrecord componentpublishedAt- the value for thepublishedAtrecord componentpasswordProtected- the value for thepasswordProtectedrecord componentjoinable- the value for thejoinablerecord componentplayerCount- the value for theplayerCountrecord componentremainingCapacity- the value for theremainingCapacityrecord componentruntimeId- the value for theruntimeIdrecord component
-
-
Method Details
-
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
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
hostId
Returns the value of thehostIdrecord component.- Returns:
- the value of the
hostIdrecord component
-
hostName
Returns the value of thehostNamerecord component.- Returns:
- the value of the
hostNamerecord component
-
gameTypeName
Returns the value of thegameTypeNamerecord component.- Returns:
- the value of the
gameTypeNamerecord component
-
sourceArenaName
Returns the value of thesourceArenaNamerecord component.- Returns:
- the value of the
sourceArenaNamerecord component
-
addonSource
public boolean addonSource()Returns the value of theaddonSourcerecord component.- Returns:
- the value of the
addonSourcerecord component
-
scenarioIds
Returns the value of thescenarioIdsrecord component.- Returns:
- the value of the
scenarioIdsrecord component
-
state
Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-
scheduledAt
public long scheduledAt()Returns the value of thescheduledAtrecord component.- Returns:
- the value of the
scheduledAtrecord component
-
publishedAt
public long publishedAt()Returns the value of thepublishedAtrecord component.- Returns:
- the value of the
publishedAtrecord component
-
passwordProtected
public boolean passwordProtected()Returns the value of thepasswordProtectedrecord component.- Returns:
- the value of the
passwordProtectedrecord component
-
joinable
public boolean joinable()Returns the value of thejoinablerecord component.- Returns:
- the value of the
joinablerecord component
-
playerCount
public int playerCount()Returns the value of theplayerCountrecord component.- Returns:
- the value of the
playerCountrecord component
-
remainingCapacity
public int remainingCapacity()Returns the value of theremainingCapacityrecord component.- Returns:
- the value of the
remainingCapacityrecord component
-
runtimeId
Returns the value of theruntimeIdrecord component.- Returns:
- the value of the
runtimeIdrecord component
-