Record Class ModeStats
java.lang.Object
java.lang.Record
dev.itsharshxd.zentrix.api.profile.ModeStats
- Record Components:
matchesPlayed- matches played in this modewins- matches won in this modekills- kills in this modedeaths- deaths in this mode
One mode's share of a profile: solo or team matches.
Modes are counted from the first match Zentrix recorded with modes, so the lifetime totals in
PlayerStats can include earlier matches neither mode holds.
- Since:
- 1.8.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionModeStats(int matchesPlayed, int wins, int kills, int deaths) Creates an instance of aModeStatsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintdeaths()Returns the value of thedeathsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.doublekdRatio()Kills per death with two decimals; the kill count when there are no deaths.intkills()Returns the value of thekillsrecord component.intlosses()Matches played but not won.intReturns the value of thematchesPlayedrecord component.final StringtoString()Returns a string representation of this record class.doublewinRate()Win rate as a percentage with two decimals, or 0 without matches.intwins()Returns the value of thewinsrecord component.
-
Field Details
-
EMPTY
No matches in this mode.
-
-
Constructor Details
-
ModeStats
public ModeStats(int matchesPlayed, int wins, int kills, int deaths) Creates an instance of aModeStatsrecord class.- Parameters:
matchesPlayed- the value for thematchesPlayedrecord componentwins- the value for thewinsrecord componentkills- the value for thekillsrecord componentdeaths- the value for thedeathsrecord component
-
-
Method Details
-
losses
public int losses()Matches played but not won. -
winRate
public double winRate()Win rate as a percentage with two decimals, or 0 without matches. -
kdRatio
public double kdRatio()Kills per death with two decimals; the kill count when there are no deaths. -
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. All components in this record class are compared with '=='. -
matchesPlayed
public int matchesPlayed()Returns the value of thematchesPlayedrecord component.- Returns:
- the value of the
matchesPlayedrecord component
-
wins
public int wins()Returns the value of thewinsrecord component.- Returns:
- the value of the
winsrecord component
-
kills
public int kills()Returns the value of thekillsrecord component.- Returns:
- the value of the
killsrecord component
-
deaths
public int deaths()Returns the value of thedeathsrecord component.- Returns:
- the value of the
deathsrecord component
-