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 fromGameObject
toArchetype
and 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 void
addFirst(G gameObject)
Adds the givenGameObject
at the beginning of this Container.void
addLast(G gameObject)
Adds the givenGameObject
at the end of this Container.@NotNull java.lang.String
getArchetypeName()
Returns the name of this archetype.@NotNull java.util.Collection<java.lang.String>
getAttributeKeys()
Returns all attribute keys of this archetype.@Nullable java.lang.String
getEditorFolder()
Returns the editor folder.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.boolean
isUndefinedArchetype()
Return whether this archetype denotes an undefined archetype.@NotNull java.util.Iterator<G>
iterator()
Returns all inventory objects.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.-
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:
iterator
in interfacejava.lang.Iterable<G extends GameObject<G,A,R>>
- Returns:
- an iterator returning all inventory objects
-
addLast
void addLast(@NotNull G gameObject)
Adds the givenGameObject
at the end of this Container.- Parameters:
gameObject
- the free yet unlinkedGameObject
to be placed in the inventory- Throws:
java.lang.IllegalArgumentException
- ifgameObject
already is inside another container
-
addFirst
void addFirst(@NotNull G gameObject)
Adds the givenGameObject
at the beginning of this Container.- Parameters:
gameObject
- the free yet unlinkedGameObject
to be placed in the inventory- Throws:
java.lang.IllegalArgumentException
- ifgameObject
already 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:
true
if 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:
true
if 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
-
-