Record Class GamevalRef
java.lang.Object
java.lang.Record
com.botwithus.bot.api.gameval.GamevalRef
- Record Components:
type- namespace the name lives ingameval- the symbolic namefallbackId- the id to use when the name does not resolve; forGamevalType.COMPONENTthe packed(interfaceId << 16) | componentId
A gameval name paired with the id it resolved to when the calling code was
written. Lets api facades address interfaces, components and variables by
name — so a game renumber is fixed by refreshing the gameval index — while
still working on a host with no index deployed.
static final GamevalRef ITEMS = new GamevalRef(GamevalType.COMPONENT, "BANK__BANK_INV",
Interfaces.componentHash(517, 201));
int hash = ITEMS.resolve(api.gamevals());
-
Constructor Summary
ConstructorsConstructorDescriptionGamevalRef(GamevalType type, String gameval, int fallbackId) Creates an instance of aGamevalRefrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intReturns the value of thefallbackIdrecord component.gameval()Returns the value of thegamevalrecord component.final inthashCode()Returns a hash code value for this object.intresolve(GamevalIndex index) The idindexresolvesgameval()to, orfallbackId()when the name is unknown or no index is deployed.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
GamevalRef
Creates an instance of aGamevalRefrecord class.- Parameters:
type- the value for thetyperecord componentgameval- the value for thegamevalrecord componentfallbackId- the value for thefallbackIdrecord component
-
-
Method Details
-
resolve
The idindexresolvesgameval()to, orfallbackId()when the name is unknown or no index is deployed. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
type
-
gameval
-
fallbackId
public int fallbackId()Returns the value of thefallbackIdrecord component.- Returns:
- the value of the
fallbackIdrecord component
-