Gridarta Editor
net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R > Interface Template Reference

Reflects an Archetype. More...

+ Inheritance diagram for net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:
+ Collaboration diagram for net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:

Public Member Functions

void addFirst (@NotNull G gameObject)
 Adds the given GameObject at the beginning of this Container. More...
 
void addLast (@NotNull G gameObject)
 Adds the given GameObject at the end of this Container. More...
 
String getArchetypeName ()
 Returns the name of this archetype. More...
 
Collection< String > getAttributeKeys ()
 Returns all attribute keys of this archetype. More...
 
String getEditorFolder ()
 Returns the editor folder. More...
 
int getMultiPartNr ()
 Returns the multi part id. More...
 
int getMultiShapeID ()
 Returns the multi shape id. More...
 
int getMultiX ()
 Returns the x-distance of this part to the head part. More...
 
int getMultiY ()
 Returns the y-distance of this part to the head part. More...
 
boolean isArtifact ()
 Returns whether this GameObject is an Artifact. More...
 
boolean isLowestPart ()
 Returns whether this part has the smallest y coordinate when painting the image. More...
 
boolean isUndefinedArchetype ()
 Return whether this archetype denotes an undefined archetype. More...
 
Iterator< G > iterator ()
 Returns all inventory objects. More...
 
void setArchetypeName (@NotNull String archetypeName)
 Sets the name of this archetype. More...
 
void setArtifact ()
 Converts this game object into an artifact. More...
 
void setEditorFolder (@Nullable String editorFolder)
 Set the editor folder. More...
 
void setLowestPart (boolean isLowestPart)
 Sets whether this part has the smallest y coordinate when painting the image. More...
 
void setMultiPartNr (int multiPartNr)
 Sets the multi part id. More...
 
void setMultiShapeID (int multiShapeID)
 Sets the multi shape id. More...
 
void setMultiX (int multiX)
 Sets the x-position of this part of a multi-part object. More...
 
void setMultiY (int multiY)
 Sets the y-position of this part of a multi-part object. More...
 
- Public Member Functions inherited from net.sf.gridarta.model.baseobject.BaseObject< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R, T extends BaseObject< G, A, R, T >
void addMsgTextLine (@NotNull String text)
 Adds a line of message text. More...
 
void addObjectText (@NotNull String line)
 Appends. More...
 
void addTailPart (@NotNull T tail)
 Appends a tail to this GameObject. More...
 
clone ()
 Creates a clone of this base object. More...
 
int countInvObjects ()
 Counts the number of all inventory items (recursively). More...
 
void facesReloaded ()
 Will be called whenever the archetype faces have been reloaded. More...
 
String getAnimName ()
 DaiEditor only: Returns the name of the animation. More...
 
getArchetype ()
 Returns the Archetype this GameObject is based on. More...
 
double getAttributeDouble (@NotNull String attributeName, boolean queryArchetype)
 Returns the requested attribute value of this GameObject as. More...
 
int getAttributeInt (@NotNull String attributeName, boolean queryArchetype)
 Returns the requested attribute value of this GameObject as. More...
 
long getAttributeLong (@NotNull String attributeName, boolean queryArchetype)
 Returns the requested attribute value of this GameObject as. More...
 
String getAttributeString (@NotNull String attributeName, boolean queryArchetype)
 Returns the requested attribute value of this GameObject as {}. More...
 
String getBestName ()
 Returns the name which is best appropriate to describe this GameObject. More...
 
int getDirection ()
 Returns the direction of this Archetype or GameObject. More...
 
int getEditType ()
 Returns the edit type. More...
 
String getFaceName ()
 Returns the name of the face of this Archetype or GameObject. More...
 
String getFaceObjName ()
 Returns the face name, can be from animation or face. More...
 
FaceSource getFaceObjSource ()
 Returns the FaceSource of this base object. More...
 
getHead ()
 Return the head part of a multi-part object. More...
 
String getLoreText ()
 Returns the map lore. More...
 
Point getMapLocation ()
 Returns the coordinate of this GameObject on its map. More...
 
int getMapX ()
 Returns the X coordinate of this GameObject on its map. More...
 
int getMapY ()
 Returns the Y coordinate of this GameObject on its map. More...
 
int getMaxX ()
 Determines the maximum x-coordinate of any part relative to the head part. More...
 
int getMaxY ()
 Determines the maximum y-coordinate of any part relative to the head part. More...
 
int getMinX ()
 Determines the minimum x-coordinate of any part relative to the head part. More...
 
int getMinY ()
 Determines the minimum y-coordinate of any part relative to the head part. More...
 
String getMsgText (boolean queryArchetype)
 Returns the message bound to this object. More...
 
getMultiNext ()
 Returns the next of this multi-part object. More...
 
int getMultiRefCount ()
 Returns the number of parts for multi-part heads. More...
 
ImageIcon getNormalImage ()
 Returns the normal face for this GameObject. More...
 
String getObjectText ()
 Returns the object text of this GameObject as String. More...
 
String getObjName ()
 Returns the name of the object as shown to the player. More...
 
int getSizeX ()
 Determines the horizontal extent in squares. More...
 
int getSizeY ()
 Determines the vertical extent in squares. More...
 
int getTypeNo ()
 Returns the type number of this Archetype. More...
 
boolean hasAttribute (@NotNull String attributeName, boolean queryArchetype)
 Returns whether an attribute name exists. More...
 
boolean isDefaultGameObject ()
 Returns whether this game object is unmodified from its underlying archetype. More...
 
boolean isEqual (@NotNull BaseObject<?, ?, ?, ?> gameObject)
 Compares this object to another game object. More...
 
boolean isHead ()
 Returns whether this object is a single-part object or the head of the multi-part object. More...
 
boolean isMulti ()
 Returns whether this Archetype is a multi-part object. More...
 
boolean isTail ()
 Determines if this part is a tail part. More...
 
newInstance (@NotNull GameObjectFactory< G, A, R > gameObjectFactory)
 Creates a new GameObject instance: an Archetype is instantiated, a GameObject is cloned. More...
 
void notifyBeginChange ()
 Notifies the map model that this container is about to change. More...
 
void notifyEndChange ()
 Notifies the map model that this container has changed. More...
 
void notifyTransientChange ()
 Notifies the map model that this container has changed but need not be restored by undo/redo. More...
 
void removeTailParts ()
 Removes all tail parts of this game object. More...
 
void setAttributeString (@NotNull String attributeName, @NotNull String value)
 Sets the String of an archetype attribute in the objectText. More...
 
void setEditType (int editType)
 Sets the edit type. More...
 
void setLoreText (@NotNull CharSequence loreText)
 Sets the map lore. More...
 
void setMapX (int mapX)
 Sets the X coordinate of this GameObject on its map. More...
 
void setMapY (int mapY)
 Sets the Y coordinate of this GameObject on its map. More...
 
void setMsgText (@Nullable String msgText)
 Sets the message text. More...
 
void setMulti (@NotNull MultiArchData< G, A, R, T > multi)
 
void setObjectFace ()
 We set here the real face of the objects, depending on the set face and the set animation. More...
 
void setObjectText (@NotNull String objectText)
 Sets. More...
 
String toString (@NotNull String format)
 Returns a string representation of this game object. More...
 
boolean usesDirection ()
 Return whether this base object uses the "direction" attribute. More...
 
void visit (@NotNull BaseObjectVisitor< G, A, R > baseObjectVisitor)
 Calls the appropriate. More...
 
- Public Member Functions inherited from net.sf.gridarta.model.baseobject.Attributes
double getAttributeDouble (@NotNull String attributeName)
 Returns an attribute value of this Archetype as double. More...
 
int getAttributeInt (@NotNull String attributeName)
 Returns an attribute value of this Archetype as int. More...
 
long getAttributeLong (@NotNull String attributeName)
 Returns an attribute value of this Archetype as long. More...
 
String getAttributeString (@NotNull String attributeName)
 Returns the requested attribute value of this GameObject as {}. More...
 
boolean hasAttribute (@NotNull String attributeName)
 Returns whether an attribute name exists. More...
 
void removeAttribute (@NotNull String attributeName)
 Removes the String of an archetype attribute from the objectText. More...
 
void setAttributeInt (@NotNull String attributeName, int value)
 Sets an int value attribute. More...
 

Additional Inherited Members

- Public Attributes inherited from net.sf.gridarta.model.baseobject.BaseObject< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R, T extends BaseObject< G, A, R, T >
String ANIM_SPEED = "anim_speed"
 The name of the "anim_speed" attribute. More...
 
String ANIMATION = "animation"
 The attribute name of the object's animation. More...
 
String BLOCKSVIEW = "blocksview"
 The name of the "blocksview" attribute. More...
 
String DIRECTION = "direction"
 The attribute name of the object's direction. More...
 
int EDIT_TYPE_NONE = 0x10000
 
String FACE = "face"
 The attribute name of the object's face. More...
 
String HP = "hp"
 The attribute name of the "hp" attribute. More...
 
String IS_ANIMATED = "is_animated"
 The attribute name of the "is_animated" flag. More...
 
String IS_TURNABLE = "is_turnable"
 The name of the "is_turnable" attribute. More...
 
String LAST_HEAL = "last_heal"
 The name of the "last_heal" attribute. More...
 
String LEVEL = "level"
 The name of the "level" attribute. More...
 
String NAME = "name"
 The attribute name of the object's name. More...
 
String NO_PASS = "no_pass"
 The name of the "no_pass" attribute. More...
 
String NO_PICK = "no_pick"
 The name of the "no_pick" attribute. More...
 
String SLAYING = "slaying"
 The name of the "slaying" attribute. More...
 
String SP = "sp"
 The attribute name of the "sp" attribute. More...
 
String TITLE = "title"
 The attribute name of the object's title. More...
 
String TYPE = "type"
 The attribute name of the object's type. More...
 

Detailed Description

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 from GameObject to Archetype 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.

Author
Christian Hujer

Definition at line 41 of file Archetype.java.

Member Function Documentation

◆ addFirst()

void net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.addFirst ( @NotNull G  gameObject)

Adds the given GameObject at the beginning of this Container.

Parameters
gameObjectthe free yet unlinked
GameObject
to be placed in the inventory
Exceptions
IllegalArgumentExceptionif
gameObject
already is inside another container

◆ addLast()

void net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.addLast ( @NotNull G  gameObject)

Adds the given GameObject at the end of this Container.

Parameters
gameObjectthe free yet unlinked
GameObject
to be placed in the inventory
Exceptions
IllegalArgumentExceptionif
gameObject
already is inside another container

Referenced by net.sf.gridarta.model.gameobject.GameObjectFactoryTest.testUpdateFaceInformation().

+ Here is the caller graph for this function:

◆ getArchetypeName()

String net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getArchetypeName ( )

Returns the name of this archetype.

Returns
the name

Referenced by net.sf.gridarta.model.autojoin.AutojoinLists< net.sf.gridarta.model.gameobject.TestGameObject, net.sf.gridarta.model.maparchobject.TestMapArchObject, net.sf.gridarta.model.archetype.TestArchetype >.addAutojoinList(), net.sf.gridarta.gui.dialog.gameobjectattributes.GameObjectAttributesDialog< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.buildHeader(), net.sf.gridarta.gui.panel.archetypechooser.ArchetypeNameCellRenderer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.compare(), net.sf.gridarta.gui.panel.archetypechooser.ArchetypeIconCellRenderer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.compare(), net.sf.gridarta.gui.panel.archetypechooser.DisplayNameCellRenderer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.compare(), net.sf.gridarta.model.baseobject.AbstractBaseObject< G, A, R, G >.getBestName(), net.sf.gridarta.gui.panel.archetypechooser.ArchetypeNameCellRenderer< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getListCellRendererComponent(), net.sf.gridarta.gui.dialog.browsearchetypes.BrowseArchetypesTableModel< G, A, R >.getValueAt(), net.sf.gridarta.gui.dialog.findarchetypes.TableModel< G, A, R >.getValueAt(), net.sf.gridarta.gui.dialog.replace.ReplaceUtilsTest.replace_withElevation_retainsElevation(), and net.sf.gridarta.plugin.parameter.PluginParameterCodecTest.testArchetypeToXml3().

+ Here is the caller graph for this function:

◆ getAttributeKeys()

Collection<String> net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getAttributeKeys ( )

Returns all attribute keys of this archetype.

Returns
the attribute keys

◆ getEditorFolder()

String net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getEditorFolder ( )

Returns the editor folder.

Returns
the editor folder

Referenced by net.sf.gridarta.gui.dialog.findarchetypes.TableModel< G, A, R >.getValueAt().

+ Here is the caller graph for this function:

◆ getMultiPartNr()

int net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getMultiPartNr ( )

Returns the multi part id.

Returns
the multi part id

Referenced by net.sf.gridarta.var.daimonin.model.io.ArchetypeParser.calculateLowestMulti(), and net.sf.gridarta.var.atrinik.model.io.ArchetypeParser.calculateLowestMulti().

+ Here is the caller graph for this function:

◆ getMultiShapeID()

int net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getMultiShapeID ( )

Returns the multi shape id.

Returns
the multi shape id

Referenced by net.sf.gridarta.var.daimonin.model.io.ArchetypeParser.calculateLowestMulti(), and net.sf.gridarta.var.atrinik.model.io.ArchetypeParser.calculateLowestMulti().

+ Here is the caller graph for this function:

◆ getMultiX()

int net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.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 net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.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

◆ isArtifact()

boolean net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.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, otherwise
false
.

◆ isLowestPart()

boolean net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isLowestPart ( )

Returns whether this part has the smallest y coordinate when painting the image.

Returns
whether this part has the smallest y coordinate

◆ isUndefinedArchetype()

boolean net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isUndefinedArchetype ( )

Return whether this archetype denotes an undefined archetype.

Returns
true
if this archetype denotes an undefined archetype

◆ iterator()

Iterator<G> net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.iterator ( )

Returns all inventory objects.

Returns
an iterator returning all inventory objects

Referenced by net.sf.gridarta.var.crossfire.model.io.ArchetypeParserTest.testInventoryGameObjects(), and net.sf.gridarta.var.atrinik.model.io.ArchetypeParserTest.testInventoryGameObjects().

+ Here is the caller graph for this function:

◆ setArchetypeName()

void net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setArchetypeName ( @NotNull String  archetypeName)

Sets the name of this archetype.

Parameters
archetypeNamethe name

◆ setArtifact()

void net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setArtifact ( )

Converts this game object into an artifact.

See also
isArtifact()

◆ setEditorFolder()

void net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setEditorFolder ( @Nullable String  editorFolder)

Set the editor folder.

Parameters
editorFolderthe editor folder

◆ setLowestPart()

void net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setLowestPart ( boolean  isLowestPart)

Sets whether this part has the smallest y coordinate when painting the image.

Parameters
isLowestPartwhether this part has the smallest y coordinate

◆ setMultiPartNr()

void net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setMultiPartNr ( int  multiPartNr)

Sets the multi part id.

Parameters
multiPartNrthe multi part id

◆ setMultiShapeID()

void net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setMultiShapeID ( int  multiShapeID)

Sets the multi shape id.

Parameters
multiShapeIDthe multi shape id

◆ setMultiX()

void net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.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
multiXthe x-distance of this part to the head part

Referenced by net.sf.gridarta.model.floodfill.FillUtilsTest.testFillAdjacent(), net.sf.gridarta.model.mapmodel.TestMapModelHelper.TestMapModelHelper(), and net.sf.gridarta.model.io.DefaultMapReaderTest.testReorderMultiSquares().

+ Here is the caller graph for this function:

◆ setMultiY()

void net.sf.gridarta.model.archetype.Archetype< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.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
multiYthe y-distance of this part to the head part

Referenced by net.sf.gridarta.model.floodfill.FillUtilsTest.testFillAdjacent(), and net.sf.gridarta.model.mapmodel.DefaultMapModelTest.testGetAllGameObjects1().

+ Here is the caller graph for this function:

The documentation for this interface was generated from the following file: