Class GameObjectDefinition
- java.lang.Object
-
- com.runemate.game.api.hybrid.entities.definitions.GameObjectDefinition
-
- All Implemented Interfaces:
Identifiable
,Onymous
- Direct Known Subclasses:
CacheObjectDefinition.Extended
public abstract class GameObjectDefinition extends java.lang.Object implements Onymous, Identifiable
The definition of an in-game object
-
-
Constructor Summary
Constructors Constructor Description GameObjectDefinition()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static @Nullable GameObjectDefinition
get(int id)
Gets the definition for the object with the specified idstatic @NonNull java.util.List<GameObjectDefinition>
get(int first, int last)
Gets a list of definitions within the range of [first, last]static @NonNull java.util.List<GameObjectDefinition>
get(int first, int last, java.util.function.Predicate<GameObjectDefinition> filter)
Gets a list of definitions within the range of [first, last] that are accepted by the filterabstract @NonNull java.util.List<java.lang.String>
getActions()
Gets the powers that can be performed on the objectabstract @NonNull java.util.List<java.lang.Integer>
getAnimationIds()
Gets a list of all possible animations that can be performed by this objectabstract @NonNull java.util.List<java.lang.Integer>
getAppearance()
Gets a list of integers that are used to represent this entities appearance.abstract @Nullable Attribute
getAttribute(long id)
Gets the attribute with the specified idabstract java.util.List<Attribute>
getAttributes()
Gets a list of all of the objects attributes.abstract int
getClippingType()
Gets the objects clipping type, used to calculate collisionsabstract java.util.Map<java.awt.Color,java.awt.Color>
getColorSubstitutions()
Gets a mapping of colors that are to be substituted in the base model.abstract int
getHeight()
Gets the objects height (in tiles)abstract int
getId()
Gets an identifier used to identify the objectabstract @Nullable GameObjectDefinition
getLocalState()
Gets the GameObjectDefinition containing data for this objects current state (transformation).abstract int
getMapFunction()
The circular icons that are displayed on the map and minimap as an indicatorabstract int
getMapScene()
Object icons that are rendered on the map and minimap such as trees, rocks, bushes, etc.abstract java.util.Map<Material,Material>
getMaterialSubstitutions()
Gets a mapping of materials that are to be substituted in the base model.abstract int[]
getModelTypes()
abstract int
getModelXScale()
abstract int
getModelXTranslation()
abstract int
getModelYScale()
abstract int
getModelYTranslation()
abstract int
getModelZScale()
abstract int
getModelZTranslation()
abstract @NonNull java.lang.String
getName()
abstract java.lang.String[]
getRawActions()
abstract @Nullable Varbit
getStateVarbit()
TheVarbit
responsible for controlling the state (GameObjectDefinition) of the GameObject, if present.abstract @Nullable Varp
getStateVarp()
TheVarp
responsible for controlling the state (GameObjectDefinition) of the GameObject, if present.abstract @NonNull java.util.Collection<GameObjectDefinition>
getTransformations()
Gets all the possible transformations for the given game object.abstract int
getWidth()
Gets the objects width (in tiles)abstract boolean
impassable()
A flag that is used to determine whether or not certain objects can be walked on.abstract boolean
impenetrable()
Determines whether or not projectiles can bypass/go through the object to reach their targetsabstract boolean
isInteractable()
abstract boolean
isModelMirrorable()
static @NonNull java.util.List<GameObjectDefinition>
loadAll()
Loads all definitionsstatic @NonNull java.util.List<GameObjectDefinition>
loadAll(java.util.function.Predicate<GameObjectDefinition> filter)
Loads all definitions that are accepted by the filterjava.lang.String
toString()
-
-
-
Method Detail
-
get
@NonNull public static @NonNull java.util.List<GameObjectDefinition> get(int first, int last)
Gets a list of definitions within the range of [first, last]
-
get
@NonNull public static @NonNull java.util.List<GameObjectDefinition> get(int first, int last, java.util.function.Predicate<GameObjectDefinition> filter)
Gets a list of definitions within the range of [first, last] that are accepted by the filter
-
get
@Nullable public static @Nullable GameObjectDefinition get(int id)
Gets the definition for the object with the specified id- Returns:
- The definition if available, otherwise null
-
loadAll
@NonNull public static @NonNull java.util.List<GameObjectDefinition> loadAll()
Loads all definitions
-
loadAll
@NonNull public static @NonNull java.util.List<GameObjectDefinition> loadAll(java.util.function.Predicate<GameObjectDefinition> filter)
Loads all definitions that are accepted by the filter
-
getLocalState
@Nullable public abstract @Nullable GameObjectDefinition getLocalState()
Gets the GameObjectDefinition containing data for this objects current state (transformation). For example, in farming the patch id doesn't change when your player plants something in it, however it's local state does. This GameObjectDefinition contains information such as a plant specific id, the plants specific name, and the available powers.- Returns:
- a GameObjectDefinition if the objects state changes locally, otherwise null
-
getTransformations
@NonNull public abstract @NonNull java.util.Collection<GameObjectDefinition> getTransformations()
Gets all the possible transformations for the given game object. Objects can transform based on various in game events such as activating a lodestone.- Returns:
- a non-null Collection of all possible transformations.
-
getName
@NonNull public abstract @NonNull java.lang.String getName()
-
getActions
@NonNull public abstract @NonNull java.util.List<java.lang.String> getActions()
Gets the powers that can be performed on the object
-
getRawActions
public abstract java.lang.String[] getRawActions()
-
getAnimationIds
@NonNull public abstract @NonNull java.util.List<java.lang.Integer> getAnimationIds()
Gets a list of all possible animations that can be performed by this object
-
getAppearance
@NonNull public abstract @NonNull java.util.List<java.lang.Integer> getAppearance()
Gets a list of integers that are used to represent this entities appearance. Internally these are used to generate a GameObject's Model.
-
getClippingType
public abstract int getClippingType()
Gets the objects clipping type, used to calculate collisions
-
getWidth
public abstract int getWidth()
Gets the objects width (in tiles)
-
getHeight
public abstract int getHeight()
Gets the objects height (in tiles)
-
impassable
public abstract boolean impassable()
A flag that is used to determine whether or not certain objects can be walked on. Its main purpose is for path generation.
-
getAttribute
@Nullable public abstract @Nullable Attribute getAttribute(long id)
Gets the attribute with the specified id- Returns:
- the attribute if available, otherwise null
-
getAttributes
public abstract java.util.List<Attribute> getAttributes()
Gets a list of all of the objects attributes.
-
getColorSubstitutions
public abstract java.util.Map<java.awt.Color,java.awt.Color> getColorSubstitutions()
Gets a mapping of colors that are to be substituted in the base model.
-
getMaterialSubstitutions
public abstract java.util.Map<Material,Material> getMaterialSubstitutions()
Gets a mapping of materials that are to be substituted in the base model.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getId
public abstract int getId()
Gets an identifier used to identify the object- Specified by:
getId
in interfaceIdentifiable
-
getMapFunction
public abstract int getMapFunction()
The circular icons that are displayed on the map and minimap as an indicator
-
getMapScene
public abstract int getMapScene()
Object icons that are rendered on the map and minimap such as trees, rocks, bushes, etc.
-
getModelTypes
public abstract int[] getModelTypes()
-
impenetrable
public abstract boolean impenetrable()
Determines whether or not projectiles can bypass/go through the object to reach their targets- Returns:
-
getModelXScale
public abstract int getModelXScale()
-
getModelYScale
public abstract int getModelYScale()
-
getModelZScale
public abstract int getModelZScale()
-
getModelXTranslation
public abstract int getModelXTranslation()
-
getModelYTranslation
public abstract int getModelYTranslation()
-
getModelZTranslation
public abstract int getModelZTranslation()
-
isModelMirrorable
public abstract boolean isModelMirrorable()
-
isInteractable
public abstract boolean isInteractable()
-
getStateVarp
@Nullable public abstract @Nullable Varp getStateVarp()
TheVarp
responsible for controlling the state (GameObjectDefinition) of the GameObject, if present.
-
-