Record Class PlayerStat
java.lang.Object
java.lang.Record
com.botwithus.bot.api.model.PlayerStat
- Record Components:
skillId- skill type id (StatType.idfrom the cache)actualLevel- base/true level (e.g. 99); the "real" levelboostedLevel- current displayed level including buffs/drainsexperience- total xp; fits ini32(in-game cap is 200,000,000)
public record PlayerStat(int skillId, int actualLevel, int boostedLevel, int experience)
extends Record
Snapshot of one of the local player's skill stats.
Distinct from the wire-level api.snapshot.Skill record: this is
the script-facing model with a stable level() accessor (returns
the unboosted base level — the value most level-gated content checks
against).
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerStat(int skillId, int actualLevel, int boostedLevel, int experience) Creates an instance of aPlayerStatrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of theactualLevelrecord component.intReturns the value of theboostedLevelrecord component.final booleanIndicates whether some other object is "equal to" this one.intReturns the value of theexperiencerecord component.final inthashCode()Returns a hash code value for this object.intlevel()The base (unboosted) level.intskillId()Returns the value of theskillIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PlayerStat
public PlayerStat(int skillId, int actualLevel, int boostedLevel, int experience) Creates an instance of aPlayerStatrecord class.- Parameters:
skillId- the value for theskillIdrecord componentactualLevel- the value for theactualLevelrecord componentboostedLevel- the value for theboostedLevelrecord componentexperience- the value for theexperiencerecord component
-
-
Method Details
-
level
public int level()The base (unboosted) level. Equivalent toactualLevel(); namedlevelfor ergonomics in level-gated scripts where "do I have level N" is the common question. -
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
skillId
-
actualLevel
public int actualLevel()Returns the value of theactualLevelrecord component.- Returns:
- the value of the
actualLevelrecord component
-
boostedLevel
public int boostedLevel()Returns the value of theboostedLevelrecord component.- Returns:
- the value of the
boostedLevelrecord component
-
experience
public int experience()Returns the value of theexperiencerecord component.- Returns:
- the value of the
experiencerecord component
-