Package dev.itsharshxd.zentrix.api.team
Record Class CompetingSide
java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.team.CompetingSide
- Record Components:
id- the team id for a team side, or the player's UUID as text for a solo sidekind- whether this side is a team or a single playerteamId- the team id for a team side;nullfor a solo sidemembers- every member the side had when this snapshot was taken, alive or notaliveMembers- the members still playingeliminated- whether the side is out of the match
public record CompetingSide(@NotNull String id, @NotNull CompetingSide.Kind kind, @Nullable String teamId, @NotNull Set<UUID> members, @NotNull Set<UUID> aliveMembers, boolean eliminated)
extends Record
One side competing for the win in a match: a team when the match is played in teams, otherwise a
single player.
Win conditions and placements count sides, not teams. A solo match has no teams at all, so
ZentrixGame.getTeams() is empty there while its sides are
its players. A snapshot: it does not change as the match goes on.
- Since:
- 1.8.0
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionCompetingSide(@NotNull String id, @NotNull CompetingSide.Kind kind, @Nullable String teamId, @NotNull Set<UUID> members, @NotNull Set<UUID> aliveMembers, boolean eliminated) Creates an instance of aCompetingSiderecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thealiveMembersrecord component.booleanReturns the value of theeliminatedrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull Stringid()Returns the value of theidrecord component.booleanisAlive()Whether the side is still competing.@NotNull CompetingSide.Kindkind()Returns the value of thekindrecord component.members()Returns the value of themembersrecord component.@Nullable StringteamId()Returns the value of theteamIdrecord component.The team id, for a team side.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CompetingSide
public CompetingSide(@NotNull @NotNull String id, @NotNull @NotNull CompetingSide.Kind kind, @Nullable @Nullable String teamId, @NotNull @NotNull Set<UUID> members, @NotNull @NotNull Set<UUID> aliveMembers, boolean eliminated) Creates an instance of aCompetingSiderecord class.- Parameters:
id- the value for theidrecord componentkind- the value for thekindrecord componentteamId- the value for theteamIdrecord componentmembers- the value for themembersrecord componentaliveMembers- the value for thealiveMembersrecord componenteliminated- the value for theeliminatedrecord component
-
-
Method Details
-
isAlive
public boolean isAlive()Whether the side is still competing. -
teamIdIfTeam
The team id, for a team side. -
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
-
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
teamId
Returns the value of theteamIdrecord component.- Returns:
- the value of the
teamIdrecord component
-
members
Returns the value of themembersrecord component.- Returns:
- the value of the
membersrecord component
-
aliveMembers
Returns the value of thealiveMembersrecord component.- Returns:
- the value of the
aliveMembersrecord component
-
eliminated
public boolean eliminated()Returns the value of theeliminatedrecord component.- Returns:
- the value of the
eliminatedrecord component
-