Package com.valhalla.sdk.api.entities
Class ObjectDefinition
java.lang.Object
com.valhalla.sdk.api.entities.ObjectDefinition
- All Implemented Interfaces:
Identifiable,Nameable
Immutable, revision-pinned cache definition for one scene object.
Action entries retain their cache slot, including empty entries, so the
list index maps directly to ObjectAction. Definition metadata proves
semantic identity; the containing SceneObject still supplies the
currently loaded tile and native scene-container type.
-
Constructor Summary
ConstructorsConstructorDescriptionObjectDefinition(int id, String name, List<String> actions, int sizeX, int sizeY, int interactType, int wallOrDoor, boolean obstructsGround, boolean blocksProjectile, int transformVarbit, int transformVarp, List<Integer> transforms) Creates one complete immutable cache definition. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanfindAction(String action) Resolves an exact cache action label back to its typed native slot.getAction(ObjectAction action) Returns the exact cache label for a typed menu slot.intgetId()Returns the client definition or item identifier captured in this snapshot.intgetName()Returns the captured display name.intgetSizeX()intgetSizeY()intintintbooleanTests whether an exact cache action is present in any slot.inthashCode()booleantoString()
-
Constructor Details
-
ObjectDefinition
public ObjectDefinition(int id, String name, List<String> actions, int sizeX, int sizeY, int interactType, int wallOrDoor, boolean obstructsGround, boolean blocksProjectile, int transformVarbit, int transformVarp, List<Integer> transforms) Creates one complete immutable cache definition.- Parameters:
id- object definition identifiername- exact cache name, or blank for the cache's null sentinelactions- cache action slots zero through four; empty entries are retainedsizeX- unrotated object width in tilessizeY- unrotated object height in tilesinteractType- cache interaction/collision typewallOrDoor- cache wall-or-door markerobstructsGround- cache ground-obstruction markerblocksProjectile- cache projectile-blocking markertransformVarbit- transform selector varbit, or-1transformVarp- transform selector varp, or-1transforms- ordered transform definition identifiers
-
-
Method Details
-
getId
public int getId()Description copied from interface:IdentifiableReturns the client definition or item identifier captured in this snapshot.- Specified by:
getIdin interfaceIdentifiable- Returns:
- object definition identifier
-
getName
Description copied from interface:NameableReturns the captured display name. -
getActions
- Returns:
- immutable cache action slots in native menu order
-
getAction
Returns the exact cache label for a typed menu slot.- Parameters:
action- typed object-action slot- Returns:
- the slot label, possibly blank, or empty when the cache list is shorter
-
findAction
Resolves an exact cache action label back to its typed native slot.- Parameters:
action- exact, case-sensitive cache action label- Returns:
- matching typed action, or empty when absent or ambiguous
-
hasAction
Tests whether an exact cache action is present in any slot.- Parameters:
action- exact, case-sensitive cache action label- Returns:
- whether the label is present
-
getSizeX
public int getSizeX()- Returns:
- unrotated object width in tiles
-
getSizeY
public int getSizeY()- Returns:
- unrotated object height in tiles
-
getInteractType
public int getInteractType()- Returns:
- cache interaction/collision type
-
getWallOrDoor
public int getWallOrDoor()- Returns:
- cache wall-or-door marker
-
obstructsGround
public boolean obstructsGround()- Returns:
- whether the cache marks this object as obstructing ground
-
blocksProjectile
public boolean blocksProjectile()- Returns:
- whether the cache marks this object as blocking projectiles
-
getTransformVarbit
public int getTransformVarbit()- Returns:
- transform selector varbit, or
-1
-
getTransformVarp
public int getTransformVarp()- Returns:
- transform selector varp, or
-1
-
getTransforms
- Returns:
- immutable ordered transform definition identifiers
-
equals
-
hashCode
public int hashCode() -
toString
-