Class GameObject
- java.lang.Object
-
- net.sf.gridarta.model.baseobject.GameObjectContainer<G,A,R>
-
- net.sf.gridarta.model.baseobject.AbstractBaseObject<G,A,R,G>
-
- net.sf.gridarta.model.gameobject.AbstractGameObject<G,A,R>
-
- net.sf.gridarta.model.gameobject.DefaultIsoGameObject<GameObject,MapArchObject,Archetype>
-
- net.sf.gridarta.var.atrinik.model.gameobject.GameObject
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<GameObject>,Attributes,BaseObject<GameObject,MapArchObject,Archetype,GameObject>,GameObject<GameObject,MapArchObject,Archetype>
public class GameObject extends DefaultIsoGameObject<GameObject,MapArchObject,Archetype>
Handles the Atrinik GameObjects. Usually, a GameObject that is really used is derived from a (replaceable) default arch.- See Also:
- Serialized Form
- Todo:
- this class is not always the best place for multi-part object handling,
see also
GameObjectContainerfor issues about this
-
-
Field Summary
-
Fields inherited from class net.sf.gridarta.model.gameobject.DefaultIsoGameObject
ALIGN, ALPHA, DRAW_DOUBLE, DRAW_DOUBLE_ALWAYS, GLOW_RADIUS, LAYER, MAX_SUB_LAYERS, ROTATE, SUB_LAYER, SYS_OBJECT, Z, ZOOM
-
Fields inherited from interface net.sf.gridarta.model.baseobject.BaseObject
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
-
Fields inherited from interface net.sf.gridarta.model.gameobject.GameObject
EDITOR_FOLDER_INTERN
-
-
Constructor Summary
Constructors Constructor Description GameObject(@NotNull Archetype archetype, @NotNull FaceObjectProviders faceObjectProviders, @NotNull AnimationObjects animationObjects, @NotNull ArchetypeTypeSet archetypeTypeSet)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFirst(@NotNull GameObject gameObject)Adds the given game object at the end of this container.voidaddLast(@NotNull GameObject gameObject)Adds the given game object at the end of this container.voidapplyMassChange(@NotNull java.lang.Integer @NotNull [] layers, @NotNull java.lang.Integer @NotNull [] subLayers, @NotNull java.lang.String changes)Applies mass changes to the specified object if all the match conditions are met.@NotNull GameObjectclone()Creates a clone of this base object.intgetLightRadius()Returns the effective light radius of this game object.protected @NotNull GameObjectgetThis()Returnsthisas its real type.booleanisDrawDouble(boolean drawDoubleFaces)Returns whether to draw this game object with double height.booleanisScripted()Returns whether this GameObject has one or more scripted events defined.booleanisStretched(boolean tileStretching)Returns whether to draw this game object with stretching transformation.voidpropagateElevation(@NotNull BaseObject<?,?,?,?> gameObject)If there is elevation data in the other game object, move it to here.voidupdateTileStretch(int heightValue, boolean isAbsolute, @NotNull java.lang.Integer @Nullable [] subLayers)Updates the tile stretching value of the selected object.-
Methods inherited from class net.sf.gridarta.model.gameobject.DefaultIsoGameObject
facesReloaded, getDoubleImage, getStretchedImage, getStretchFactor, getTransparentDoubleImage, getTransparentImage, getYOffset, isEqual, refreshStretchFactor, setObjectFace, usesDirection
-
Methods inherited from class net.sf.gridarta.model.gameobject.AbstractGameObject
asGameObject, getArchetype, getAttributeString, getContainer, getContainerGameObject, getEffectiveFaceName, getMapSquare, getMapSquareOptional, getNext, getPrev, getTopContainer, hasUndefinedArchetype, insertAfter, insertBefore, isBottom, isInContainer, isTop, markModified, moveBottom, moveDown, moveTop, moveUp, newInstance, notifyBeginChange, notifyEndChange, notifyTransientChange, remove, setArchetype, setContainer, visit
-
Methods inherited from class net.sf.gridarta.model.baseobject.AbstractBaseObject
addMsgTextLine, addObjectText, addTailPart, beginGameObjectChange, countInvObjects, endGameObjectChange, getAnimName, getAttributeDouble, getAttributeDouble, getAttributeInt, getAttributeInt, getAttributeKeys, getAttributeLong, getAttributeLong, getAttributeString, getAttributeValue, getBestName, getDirection, getEditType, getFaceName, getFaceObjName, getFaceObjSource, getHead, getLoreText, getMapLocation, getMapX, getMapY, getMaxX, getMaxY, getMinX, getMinY, getMsgText, getMulti, getMultiNext, getMultiRefCount, getNormalImage, getObjectText, getObjName, getSizeX, getSizeY, getTypeNo, hasAttribute, hasAttribute, isDefaultGameObject, isHead, isMulti, isTail, removeAttribute, removeTailParts, setAttributeInt, setAttributeString, setEditType, setLoreText, setMapX, setMapY, setMsgText, setMulti, setObjectText, setThisContainer, toString, updateArchetype
-
Methods inherited from class net.sf.gridarta.model.baseobject.GameObjectContainer
getFirst, getLast, getNext, getPrev, hasSameContents, insertAfter, insertBefore, isBottom, isEmpty, isTop, iterator, moveBottom, moveDown, moveTop, moveUp, recursive, remove, removeAll, replace, reverse, toString
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.sf.gridarta.model.baseobject.Attributes
getAttributeDouble, getAttributeInt, getAttributeLong, getAttributeString, hasAttribute, removeAttribute, setAttributeInt
-
Methods inherited from interface net.sf.gridarta.model.baseobject.BaseObject
addMsgTextLine, addObjectText, addTailPart, countInvObjects, getAnimName, getAttributeDouble, getAttributeInt, getAttributeLong, 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, isHead, isMulti, isTail, removeTailParts, setAttributeString, setEditType, setLoreText, setMapX, setMapY, setMsgText, setMulti, setObjectText, toString
-
-
-
-
Constructor Detail
-
GameObject
public GameObject(@NotNull @NotNull Archetype archetype, @NotNull @NotNull FaceObjectProviders faceObjectProviders, @NotNull @NotNull AnimationObjects animationObjects, @NotNull @NotNull ArchetypeTypeSet archetypeTypeSet)Creates a new instance.- Parameters:
archetype- the base archetypefaceObjectProviders- the face object providers for looking up facesanimationObjects- the animation objects for looking up animationsarchetypeTypeSet- the archetype type set for looking up archetype types
-
-
Method Detail
-
addLast
public void addLast(@NotNull @NotNull GameObject gameObject)Description copied from class:GameObjectContainerAdds the given game object at the end of this container.- Specified by:
addLastin interfaceGameObject<GameObject,MapArchObject,Archetype>- Overrides:
addLastin classGameObjectContainer<GameObject,MapArchObject,Archetype>- Parameters:
gameObject- the free yet unlinkedGameObjectto be placed in the inventory
-
addFirst
public void addFirst(@NotNull @NotNull GameObject gameObject)Description copied from class:GameObjectContainerAdds the given game object at the end of this container.- Specified by:
addFirstin interfaceGameObject<GameObject,MapArchObject,Archetype>- Overrides:
addFirstin classGameObjectContainer<GameObject,MapArchObject,Archetype>- Parameters:
gameObject- the free yet unlinkedGameObjectto be placed in the inventory
-
propagateElevation
public void propagateElevation(@NotNull @NotNull BaseObject<?,?,?,?> gameObject)Description copied from interface:GameObjectIf there is elevation data in the other game object, move it to here.- Parameters:
gameObject- the other game object
-
updateTileStretch
public void updateTileStretch(int heightValue, boolean isAbsolute, @NotNull @NotNull java.lang.Integer @Nullable [] subLayers)Description copied from interface:GameObjectUpdates the tile stretching value of the selected object.- Parameters:
heightValue- height valueisAbsolute- whether the height change value is absolute or relativesubLayers- sub-layers to affect ornullto affect all layers
-
applyMassChange
public void applyMassChange(@NotNull @NotNull java.lang.Integer @NotNull [] layers, @NotNull @NotNull java.lang.Integer @NotNull [] subLayers, @NotNull @NotNull java.lang.String changes)Description copied from interface:GameObjectApplies mass changes to the specified object if all the match conditions are met.- Parameters:
layers- layers to match, can be emptysubLayers- sub-layers to match, can be emptychanges- changes to apply
-
isDrawDouble
public boolean isDrawDouble(boolean drawDoubleFaces)
Description copied from class:DefaultIsoGameObjectReturns whether to draw this game object with double height.- Specified by:
isDrawDoublein classDefaultIsoGameObject<GameObject,MapArchObject,Archetype>- Parameters:
drawDoubleFaces- whether the "draw double faces" map view setting is enabled- Returns:
- whether to draw this game object with double height
-
isStretched
public boolean isStretched(boolean tileStretching)
Description copied from class:DefaultIsoGameObjectReturns whether to draw this game object with stretching transformation.- Specified by:
isStretchedin classDefaultIsoGameObject<GameObject,MapArchObject,Archetype>- Parameters:
tileStretching- whether the "tile-stretching" map view setting is enabled- Returns:
- whether to draw this game object with stretching transformation
-
clone
@NotNull public @NotNull GameObject clone()
Description copied from interface:BaseObjectCreates a clone of this base object.- Specified by:
clonein interfaceBaseObject<GameObject,MapArchObject,Archetype,GameObject>- Overrides:
clonein classDefaultIsoGameObject<GameObject,MapArchObject,Archetype>
-
getThis
@NotNull protected @NotNull GameObject getThis()
Description copied from class:AbstractBaseObjectReturnsthisas its real type.- Specified by:
getThisin classAbstractBaseObject<GameObject,MapArchObject,Archetype,GameObject>- Returns:
this
-
isScripted
public boolean isScripted()
Description copied from interface:GameObjectReturns whether this GameObject has one or more scripted events defined.- Returns:
trueif this GameObject has one or more scripted events, otherwisefalse
-
getLightRadius
public int getLightRadius()
Description copied from interface:GameObjectReturns the effective light radius of this game object.- Returns:
- the effective light radius or
0if this object does not emit light
-
-