Package dev.twilite.game.menu
Record Class Typecode
java.lang.Object
java.lang.Record
dev.twilite.game.menu.Typecode
public record Typecode(Coord.Map map, Typecode.EntityType type, boolean inactive, int index, int world)
extends Record
Packed entity metadata used by minimenu actions.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionTypecode(Coord.Map map, Typecode.EntityType type, boolean inactive, int index, int world) Creates an instance of aTypecoderecord class. -
Method Summary
Modifier and TypeMethodDescriptionentity()Resolves the entity referenced by this typecode.final booleanIndicates whether some other object is "equal to" this one.static TypecodefromPacked(long typecode) Decodes a packed game typecode.final inthashCode()Returns a hash code value for this object.booleaninactive()Returns the value of theinactiverecord component.intindex()Returns the value of theindexrecord component.map()Returns the value of themaprecord component.static longpack(Coord.Map coord, Typecode.EntityType type, boolean inactive, int index, int world) Packs entity metadata into the game's typecode format.longpacked()Packs this typecode instance.final StringtoString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.intworld()Returns the value of theworldrecord component.
-
Constructor Details
-
Method Details
-
fromPacked
Decodes a packed game typecode. -
packed
public long packed()Packs this typecode instance. -
entity
Resolves the entity referenced by this typecode. -
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 '=='. -
map
Returns the value of themaprecord component.- Returns:
- the value of the
maprecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
inactive
public boolean inactive()Returns the value of theinactiverecord component.- Returns:
- the value of the
inactiverecord component
-
index
public int index()Returns the value of theindexrecord component.- Returns:
- the value of the
indexrecord component
-
world
public int world()Returns the value of theworldrecord component.- Returns:
- the value of the
worldrecord component