public abstract class AbstractArchetype<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends AbstractBaseObject<G,A,R,R> implements Archetype<G,A,R>
Archetype implementations.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 | Constructor and Description |
|---|---|
protected |
AbstractArchetype(@NotNull java.lang.String archetypeName,
@NotNull FaceObjectProviders faceObjectProviders,
@NotNull AnimationObjects animationObjects)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
G |
asGameObject()
Returns this instance as a
GameObject or null if this
instance is not a game object. |
R |
clone()
Creates a clone of this base object.
|
R |
getArchetype()
Returns the Archetype this GameObject is based on.
|
@NotNull java.lang.String |
getArchetypeName()
Returns the name of this archetype.
|
@NotNull java.lang.String |
getAttributeString(@NotNull java.lang.String attributeName,
boolean queryArchetype)
Returns the requested attribute value of this GameObject as
String. |
@Nullable java.lang.String |
getEditorFolder()
Returns the editor folder.
|
protected @Nullable java.lang.String |
getEffectiveFaceName(@NotNull java.lang.String faceName)
Returns the effective face name for
AbstractBaseObject.faceName for a given real
face name. |
@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. |
int |
getMultiPartNr()
Returns the multi part id.
|
int |
getMultiShapeID()
Returns the multi shape id.
|
int |
getMultiX()
Returns the x-distance of this part to the head part.
|
int |
getMultiY()
Returns the y-distance of this part to the head part.
|
boolean |
isArtifact()
Returns whether this GameObject is an Artifact.
|
boolean |
isLowestPart()
Returns whether this part has the smallest y coordinate when painting the
image.
|
G |
newInstance(@NotNull GameObjectFactory<G,A,R> gameObjectFactory)
|
void |
notifyBeginChange()
Notifies the map model that this container is about to change.
|
void |
notifyEndChange()
Notifies the map model that this container has changed.
|
void |
notifyTransientChange()
Notifies the map model that this container has changed but need not be
restored by undo/redo.
|
void |
setArchetypeName(@NotNull java.lang.String archetypeName)
Sets the name of this archetype.
|
void |
setArtifact()
Converts this game object into an artifact.
|
void |
setEditorFolder(@Nullable java.lang.String editorFolder)
Set the editor folder.
|
void |
setLowestPart(boolean isLowestPart)
Sets whether this part has the smallest y coordinate when painting the
image.
|
void |
setMultiPartNr(int multiPartNr)
Sets the multi part id.
|
void |
setMultiShapeID(int multiShapeID)
Sets the multi shape id.
|
void |
setMultiX(int multiX)
Sets the x-position of this part of a multi-part object.
|
void |
setMultiY(int multiY)
Sets the y-position of this part of a multi-part object.
|
void |
visit(@NotNull BaseObjectVisitor<G,A,R> baseObjectVisitor)
Calls the appropriate
visit() function of a BaseObjectVisitor. |
addMsgTextLine, addObjectText, addTailPart, beginGameObjectChange, countInvObjects, endGameObjectChange, facesReloaded, 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, getThis, getTypeNo, hasAttribute, hasAttribute, isDefaultGameObject, isEqual, isHead, isMulti, isTail, removeAttribute, removeTailParts, setAttributeInt, setAttributeString, setEditType, setLoreText, setMapX, setMapY, setMsgText, setMulti, setObjectFace, setObjectText, setThisContainer, toString, updateArchetypeaddFirst, addLast, getFirst, getLast, getNext, getPrev, hasSameContents, insertAfter, insertBefore, isBottom, isEmpty, isTop, iterator, moveBottom, moveDown, moveTop, moveUp, recursive, remove, removeAll, replace, reverse, toStringequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddFirst, addLast, getAttributeKeys, isUndefinedArchetype, iteratoraddMsgTextLine, addObjectText, addTailPart, countInvObjects, facesReloaded, 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, isEqual, isHead, isMulti, isTail, removeTailParts, setAttributeString, setEditType, setLoreText, setMapX, setMapY, setMsgText, setMulti, setObjectFace, setObjectText, toString, usesDirectiongetAttributeDouble, getAttributeInt, getAttributeLong, getAttributeString, hasAttribute, removeAttribute, setAttributeIntprotected AbstractArchetype(@NotNull
@NotNull java.lang.String archetypeName,
@NotNull
@NotNull FaceObjectProviders faceObjectProviders,
@NotNull
@NotNull AnimationObjects animationObjects)
archetypeName - the name of the archetypefaceObjectProviders - the face object providers for looking up
facesanimationObjects - the animation objects for looking up animations@NotNull public @NotNull MapSquare<G,A,R> getMapSquare()
GameObjectContainerMapSquare this game object is part of.getMapSquare in class GameObjectContainer<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>@Nullable public @Nullable MapSquare<G,A,R> getMapSquareOptional()
GameObjectContainerMapSquare this game object is part of.getMapSquareOptional in class GameObjectContainer<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>null if the game object is not part of
a map@NotNull
public @NotNull java.lang.String getAttributeString(@NotNull
@NotNull java.lang.String attributeName,
boolean queryArchetype)
BaseObjectString. The attribute value is first searched in this GameObject. If
queryArchetype == true, additional search is done: if the
attribute value is not found and this GameObject is not an Archetype
itself, the attribute value is searched in this GameObject's Archetype as
well.getAttributeString in interface BaseObject<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>,R extends Archetype<G,A,R>>attributeName - the name of the attribute to search; this will be
"attributeName value" in the object
textqueryArchetype - whether to query the Archetype of this GameObject:
true if the Archetype should be queried as well, false to
ignore itAttributes.getAttributeString(String)@Nullable
protected @Nullable java.lang.String getEffectiveFaceName(@NotNull
@NotNull java.lang.String faceName)
AbstractBaseObjectAbstractBaseObject.faceName for a given real
face name.getEffectiveFaceName in class AbstractBaseObject<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>,R extends Archetype<G,A,R>>faceName - the real face namenull if the real face name is
unset or equals the archetype's face namepublic void notifyBeginChange()
GameObjectContainernotifyBeginChange in interface BaseObject<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>,R extends Archetype<G,A,R>>notifyBeginChange in class AbstractBaseObject<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>,R extends Archetype<G,A,R>>public void notifyEndChange()
GameObjectContainernotifyEndChange in interface BaseObject<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>,R extends Archetype<G,A,R>>notifyEndChange in class AbstractBaseObject<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>,R extends Archetype<G,A,R>>public void notifyTransientChange()
BaseObjectnotifyTransientChange in interface BaseObject<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>,R extends Archetype<G,A,R>>@NotNull public R getArchetype()
BaseObjectgetArchetype in interface BaseObject<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>,R extends Archetype<G,A,R>>@NotNull public R clone()
BaseObjectclone in interface BaseObject<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>,R extends Archetype<G,A,R>>clone in class AbstractBaseObject<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>,R extends Archetype<G,A,R>>@Nullable public G asGameObject()
GameObjectContainerGameObject or null if this
instance is not a game object.asGameObject in class GameObjectContainer<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>null@NotNull public G newInstance(@NotNull @NotNull GameObjectFactory<G,A,R> gameObjectFactory)
BaseObjectnewInstance in interface BaseObject<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>,R extends Archetype<G,A,R>>gameObjectFactory - the game object factory for creating new game
objectspublic void visit(@NotNull
@NotNull BaseObjectVisitor<G,A,R> baseObjectVisitor)
BaseObjectvisit() function of a BaseObjectVisitor.@NotNull public @NotNull java.lang.String getArchetypeName()
ArchetypegetArchetypeName in interface Archetype<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>public void setArchetypeName(@NotNull
@NotNull java.lang.String archetypeName)
ArchetypesetArchetypeName in interface Archetype<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>archetypeName - the namepublic void setMultiX(int multiX)
Archetypepublic void setMultiY(int multiY)
Archetypepublic int getMultiX()
Archetypepublic int getMultiY()
Archetypepublic boolean isLowestPart()
ArchetypeisLowestPart in interface Archetype<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>public void setLowestPart(boolean isLowestPart)
ArchetypesetLowestPart in interface Archetype<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>isLowestPart - whether this part has the smallest y coordinatepublic int getMultiShapeID()
ArchetypegetMultiShapeID in interface Archetype<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>public void setMultiShapeID(int multiShapeID)
ArchetypesetMultiShapeID in interface Archetype<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>multiShapeID - the multi shape idpublic int getMultiPartNr()
ArchetypegetMultiPartNr in interface Archetype<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>public void setMultiPartNr(int multiPartNr)
ArchetypesetMultiPartNr in interface Archetype<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>multiPartNr - the multi part id@Nullable public @Nullable java.lang.String getEditorFolder()
ArchetypegetEditorFolder in interface Archetype<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>public void setEditorFolder(@Nullable
@Nullable java.lang.String editorFolder)
ArchetypesetEditorFolder in interface Archetype<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>editorFolder - the editor folderpublic boolean isArtifact()
ArchetypeisArtifact in interface Archetype<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>true if this GameObject is an Artifact, otherwise false.public void setArtifact()
ArchetypesetArtifact in interface Archetype<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>Archetype.isArtifact()