public interface GameObject<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends BaseObject<G,A,R,G>
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EDITOR_FOLDER_INTERN
The editor folder name for server-internal archetypes.
|
ANIM_SPEED, ANIMATION, BLOCKSVIEW, DIRECTION, EDIT_TYPE_NONE, FACE, HP, IS_ANIMATED, IS_TURNABLE, LAST_HEAL, LEVEL, NAME, NO_PASS, NO_PICK, SLAYING, SP, TITLE, TYPE
Modifier and Type | Method and Description |
---|---|
void |
addFirst(G gameObject)
Add the given GameObject at the beginning of this Container.
|
void |
addLast(G gameObject)
Add the given GameObject at the end of this Container.
|
void |
applyMassChange(@NotNull java.lang.Integer[] layers,
@NotNull java.lang.Integer[] subLayers,
@NotNull java.lang.String changes)
Applies mass changes to the specified object if all the match conditions
are met.
|
@Nullable GameObjectContainer<G,A,R> |
getContainer()
Returns container of this GameObject.
|
G |
getContainerGameObject()
Returns the environment game object if this game object is in the
inventory or
null . |
G |
getFirst()
Return the first GameObject contained in this container.
|
G |
getLast()
Return the last GameObject contained in this container.
|
int |
getLightRadius()
Returns the effective light radius of this game object.
|
@NotNull MapSquare<G,A,R> |
getMapSquare()
Returns the
MapSquare this game object is part of. |
@Nullable MapSquare<G,A,R> |
getMapSquareOptional()
Returns the
MapSquare this game object is part of. |
G |
getNext()
Returns the game object succeeding this game object.
|
G |
getPrev()
Returns the game object preceding this game object.
|
G |
getTopContainer()
Get the topmost container of this GameObject (in Game sense, which means
being in a MapSquare isn't, but being in a GameObject is).
|
boolean |
hasUndefinedArchetype()
Return whether this instance references an undefined archetype.
|
void |
insertAfter(G node)
Insert a GameObject after this GameObject.
|
void |
insertBefore(G node)
Insert a GameObject before this GameObject.
|
boolean |
isBottom()
Returns whether this game object is the bottom-most one.
|
boolean |
isEmpty()
Check whether this square is empty.
|
boolean |
isInContainer()
Check whether this GameObject is in a Container (in Gridarta sense, which
means being in a MapSquare isn't, but being is a GameObject is).
|
boolean |
isScripted()
Returns whether this GameObject has one or more scripted events defined.
|
boolean |
isTop()
Returns whether this game object is the top-most one.
|
@NotNull java.util.Iterator<G> |
iterator()
The Iterator returned does not recurse, it only contains
objects on the first level.
|
void |
markModified()
Marks this game object as "modified".
|
void |
moveBottom()
Move this GameObject bottom.
|
void |
moveDown()
Move this GameObject down.
|
void |
moveTop()
Move this GameObject top.
|
void |
moveUp()
Move this GameObject up.
|
void |
propagateElevation(@NotNull BaseObject<?,?,?,?> gameObject)
If there is elevation data in the other game object, move it to here.
|
@NotNull java.lang.Iterable<G> |
recursive()
Return an object that is a recursive representation.
|
void |
remove()
Remove this GameObject from its container.
|
void |
removeAll()
Removes all GameObjects from this container.
|
@NotNull java.lang.Iterable<G> |
reverse()
Return an object that is the reverse representation.
|
void |
setArchetype(R archetype)
Set the Archetype of this GameObject.
|
void |
setContainer(@Nullable GameObjectContainer<G,A,R> container,
int mapX,
int mapY)
Sets container of this GameObject.
|
void |
updateTileStretch(int heightValue,
boolean isAbsolute,
@NotNull java.lang.Integer[] subLayers)
Updates the tile stretching value of the selected object.
|
addMsgTextLine, addObjectText, addTailPart, clone, countInvObjects, facesReloaded, getAnimName, getArchetype, getAttributeDouble, getAttributeInt, getAttributeLong, getAttributeString, getBestName, getDirection, getEditType, getFaceName, getFaceObjName, getFaceObjSource, getHead, getLoreText, getMapLocation, getMapX, getMapY, getMaxX, getMaxY, getMinX, getMinY, getMsgText, getMultiNext, getMultiRefCount, getNormalImage, getObjectText, getObjName, getSizeX, getSizeY, getTypeNo, hasAttribute, isDefaultGameObject, isEqual, isHead, isMulti, isTail, newInstance, notifyBeginChange, notifyEndChange, notifyTransientChange, removeTailParts, setAttributeString, setEditType, setLoreText, setMapX, setMapY, setMsgText, setMulti, setObjectFace, setObjectText, toString, usesDirection, visit
getAttributeDouble, getAttributeInt, getAttributeLong, getAttributeString, hasAttribute, removeAttribute, setAttributeInt
static final java.lang.String EDITOR_FOLDER_INTERN
void removeAll()
void addLast(@NotNull G gameObject)
gameObject
- the free yet unlinked GameObject
to be placed
in the inventoryjava.lang.IllegalArgumentException
- if gameObject
already is inside
another container@Nullable G getLast()
null
if isEmpty()
returns true
void addFirst(@NotNull G gameObject)
gameObject
- the free yet unlinked GameObject
to be placed
in the inventoryjava.lang.IllegalArgumentException
- if gameObject
already is inside
another container@Nullable G getFirst()
null
if isEmpty()
returns true
void propagateElevation(@NotNull @NotNull BaseObject<?,?,?,?> gameObject)
gameObject
- the other game objectvoid updateTileStretch(int heightValue, boolean isAbsolute, @NotNull @NotNull java.lang.Integer[] subLayers)
heightValue
- height valueisAbsolute
- whether the height change value is absolute or
relativesubLayers
- sub-layers to affect or null
to affect all
layersvoid applyMassChange(@NotNull @NotNull java.lang.Integer[] layers, @NotNull @NotNull java.lang.Integer[] subLayers, @NotNull @NotNull java.lang.String changes)
layers
- layers to match, can be emptysubLayers
- sub-layers to match, can be emptychanges
- changes to apply@NotNull @NotNull java.util.Iterator<G> iterator()
iterator
in interface java.lang.Iterable<G extends GameObject<G,A,R>>
@NotNull @NotNull java.lang.Iterable<G> reverse()
@NotNull @NotNull java.lang.Iterable<G> recursive()
boolean isScripted()
true
if this GameObject has one or more scripted events,
otherwise false
boolean isEmpty()
true
if this square is empty, otherwise false
void remove()
@Nullable @Nullable GameObjectContainer<G,A,R> getContainer()
null
for this).
getTopContainer()
boolean isTop()
boolean isBottom()
void moveTop()
void moveUp()
void moveDown()
void moveBottom()
void insertBefore(@NotNull G node)
node
- GameObject to appendvoid insertAfter(@NotNull G node)
node
- GameObject to append@Nullable G getContainerGameObject()
null
.null
@NotNull G getTopContainer()
getContainer()
void setContainer(@Nullable @Nullable GameObjectContainer<G,A,R> container, int mapX, int mapY)
container
- the container of this game objectmapX
- the x coordinate on the map or 0
mapY
- the y coordinate on the map or 0
java.lang.IllegalStateException
- in case this GameObject is an Archetype
(Archetypes must not be added to a map).boolean isInContainer()
true
if this GameObject has a Container and the Container
is a GameObject, otherwise (no Container or Container is not an
GameObject) false@NotNull @NotNull MapSquare<G,A,R> getMapSquare()
MapSquare
this game object is part of.java.lang.IllegalStateException
- if the game object is not part of a map@Nullable @Nullable MapSquare<G,A,R> getMapSquareOptional()
MapSquare
this game object is part of.null
if the game object is not part of
a map@Nullable G getPrev()
null
if no preceding game
object exists.@Nullable G getNext()
null
if no successor game
object exists.void setArchetype(@NotNull R archetype)
archetype
- the new archetype of this game objectBaseObject.getArchetype()
boolean hasUndefinedArchetype()
true
if this instance references an undefined archetypevoid markModified()
int getLightRadius()
0
if this object does not
emit light