Package net.sf.gridarta.model.archetype
Interface Archetype<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>>
-
- All Superinterfaces:
Attributes,BaseObject<G,A,R,R>,java.lang.Cloneable,java.lang.Iterable<G>,java.io.Serializable
- All Known Implementing Classes:
AbstractArchetype,DefaultArchetype,DefaultArchetype,DefaultArchetype,UndefinedArchetype,UndefinedArchetype,UndefinedArchetype
public interface Archetype<G extends GameObject<G,A,R>,A extends MapArchObject<A>,R extends Archetype<G,A,R>> extends BaseObject<G,A,R,R>
Reflects an Archetype. This interface is part of extracting the Archetype functionality from GameObject into a class of its own. The plan is to let GameObject implement this interface and change the type of getArchetype() and other Archetype related methods fromGameObjecttoArchetypeand see what breaks. Then all method signatures are copied to this interface. Once that is done we technically know what an Archetype is and can create a class for it. Once the Archetype classes are finished, GameObject will no longer implement Archetype and we've separated Archetype from GameObject.
-
-
Field Summary
-
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
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddFirst(G gameObject)Adds the givenGameObjectat the beginning of this Container.voidaddLast(G gameObject)Adds the givenGameObjectat the end of this Container.@NotNull java.lang.StringgetArchetypeName()Returns the name of this archetype.@NotNull java.util.Collection<java.lang.String>getAttributeKeys()Returns all attribute keys of this archetype.@Nullable java.lang.StringgetEditorFolder()Returns the editor folder.intgetMultiPartNr()Returns the multi part id.intgetMultiShapeID()Returns the multi shape id.intgetMultiX()Returns the x-distance of this part to the head part.intgetMultiY()Returns the y-distance of this part to the head part.booleanisArtifact()Returns whether this GameObject is an Artifact.booleanisLowestPart()Returns whether this part has the smallest y coordinate when painting the image.booleanisUndefinedArchetype()Return whether this archetype denotes an undefined archetype.@NotNull java.util.Iterator<G>iterator()Returns all inventory objects.voidsetArchetypeName(@NotNull java.lang.String archetypeName)Sets the name of this archetype.voidsetArtifact()Converts this game object into an artifact.voidsetEditorFolder(@Nullable java.lang.String editorFolder)Set the editor folder.voidsetLowestPart(boolean isLowestPart)Sets whether this part has the smallest y coordinate when painting the image.voidsetMultiPartNr(int multiPartNr)Sets the multi part id.voidsetMultiShapeID(int multiShapeID)Sets the multi shape id.voidsetMultiX(int multiX)Sets the x-position of this part of a multi-part object.voidsetMultiY(int multiY)Sets the y-position of this part of a multi-part object.-
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, 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
-
-
-
-
Method Detail
-
iterator
@NotNull @NotNull java.util.Iterator<G> iterator()
Returns all inventory objects.- Specified by:
iteratorin interfacejava.lang.Iterable<G extends GameObject<G,A,R>>- Returns:
- an iterator returning all inventory objects
-
addLast
void addLast(@NotNull G gameObject)Adds the givenGameObjectat the end of this Container.- Parameters:
gameObject- the free yet unlinkedGameObjectto be placed in the inventory- Throws:
java.lang.IllegalArgumentException- ifgameObjectalready is inside another container
-
addFirst
void addFirst(@NotNull G gameObject)Adds the givenGameObjectat the beginning of this Container.- Parameters:
gameObject- the free yet unlinkedGameObjectto be placed in the inventory- Throws:
java.lang.IllegalArgumentException- ifgameObjectalready is inside another container
-
getArchetypeName
@NotNull @NotNull java.lang.String getArchetypeName()
Returns the name of this archetype.- Returns:
- the name
-
setArchetypeName
void setArchetypeName(@NotNull @NotNull java.lang.String archetypeName)Sets the name of this archetype.- Parameters:
archetypeName- the name
-
isUndefinedArchetype
boolean isUndefinedArchetype()
Return whether this archetype denotes an undefined archetype.- Returns:
trueif this archetype denotes an undefined archetype
-
setMultiX
void setMultiX(int multiX)
Sets the x-position of this part of a multi-part object. The x-position is relative to the head part.- Parameters:
multiX- the x-distance of this part to the head part
-
setMultiY
void setMultiY(int multiY)
Sets the y-position of this part of a multi-part object. The y-position is relative to the head part.- Parameters:
multiY- the y-distance of this part to the head part
-
getMultiX
int getMultiX()
Returns the x-distance of this part to the head part. For single-part objects this is always zero.- Returns:
- the x-distance of this part to the head part
-
getMultiY
int getMultiY()
Returns the y-distance of this part to the head part. For single-part objects this is always zero.- Returns:
- the y-distance of this part to the head part
-
isLowestPart
boolean isLowestPart()
Returns whether this part has the smallest y coordinate when painting the image.- Returns:
- whether this part has the smallest y coordinate
-
setLowestPart
void setLowestPart(boolean isLowestPart)
Sets whether this part has the smallest y coordinate when painting the image.- Parameters:
isLowestPart- whether this part has the smallest y coordinate
-
getMultiShapeID
int getMultiShapeID()
Returns the multi shape id.- Returns:
- the multi shape id
-
setMultiShapeID
void setMultiShapeID(int multiShapeID)
Sets the multi shape id.- Parameters:
multiShapeID- the multi shape id
-
getMultiPartNr
int getMultiPartNr()
Returns the multi part id.- Returns:
- the multi part id
-
setMultiPartNr
void setMultiPartNr(int multiPartNr)
Sets the multi part id.- Parameters:
multiPartNr- the multi part id
-
getEditorFolder
@Nullable @Nullable java.lang.String getEditorFolder()
Returns the editor folder.- Returns:
- the editor folder
-
setEditorFolder
void setEditorFolder(@Nullable @Nullable java.lang.String editorFolder)Set the editor folder.- Parameters:
editorFolder- the editor folder
-
isArtifact
boolean isArtifact()
Returns whether this GameObject is an Artifact. Artifacts are special forms of Archetypes, and they are excluded from Archetypes collection.- Returns:
trueif this GameObject is an Artifact, otherwisefalse.
-
setArtifact
void setArtifact()
Converts this game object into an artifact.- See Also:
isArtifact()
-
getAttributeKeys
@NotNull @NotNull java.util.Collection<java.lang.String> getAttributeKeys()
Returns all attribute keys of this archetype.- Returns:
- the attribute keys
-
-