20 package net.sf.gridarta.model.baseobject;
22 import java.awt.Point;
23 import java.io.Serializable;
24 import javax.swing.ImageIcon;
31 import org.jetbrains.annotations.NotNull;
32 import org.jetbrains.annotations.Nullable;
34 public interface BaseObject<G
extends GameObject<G, A, R>, A extends
MapArchObject<A>, R extends
Archetype<G, A, R>, T extends
BaseObject<G, A, R, T>> extends
Attributes, Cloneable, Iterable<G>, Serializable {
168 boolean hasAttribute(@NotNull String attributeName,
boolean queryArchetype);
197 int getAttributeInt(@NotNull String attributeName,
boolean queryArchetype);
208 long getAttributeLong(@NotNull String attributeName,
boolean queryArchetype);
585 String
toString(@NotNull String format);
ImageIcon getNormalImage()
Returns the normal face for this GameObject.
String IS_TURNABLE
The name of the "is_turnable" attribute.
T getHead()
Return the head part of a multi-part object.
A set of key/value pairs.
int getMaxX()
Determines the maximum x-coordinate of any part relative to the head part.
String LEVEL
The name of the "level" attribute.
String getObjName()
Returns the name of the object as shown to the player.
boolean hasAttribute(@NotNull String attributeName, boolean queryArchetype)
Returns whether an attribute name exists.
T getMultiNext()
Returns the next of this multi-part object.
void facesReloaded()
Will be called whenever the archetype faces have been reloaded.
String getFaceObjName()
Returns the face name, can be from animation or face.
String ANIM_SPEED
The name of the "anim_speed" attribute.
void notifyTransientChange()
Notifies the map model that this container has changed but need not be restored by undo/redo...
Enumeration describing the state of the face.
String ANIMATION
The attribute name of the object's animation.
String FACE
The attribute name of the object's face.
void setMsgText(@Nullable String msgText)
Sets the message text.
void addMsgTextLine(@NotNull String text)
Adds a line of message text.
void setLoreText(@NotNull CharSequence loreText)
Sets the map lore.
FaceSource getFaceObjSource()
Returns the FaceSource of this base object.
int getMultiRefCount()
Returns the number of parts for multi-part heads.
int getSizeY()
Determines the vertical extent in squares.
String SLAYING
The name of the "slaying" attribute.
String getAttributeString(@NotNull String attributeName, boolean queryArchetype)
Returns the requested attribute value of this GameObject as String.
String TYPE
The attribute name of the object's type.
String NO_PASS
The name of the "no_pass" attribute.
void notifyEndChange()
Notifies the map model that this container has changed.
String LAST_HEAL
The name of the "last_heal" attribute.
int getMapX()
Returns the X coordinate of this GameObject on its map.
Base package of all Gridarta classes.
void setMapX(int mapX)
Sets the X coordinate of this GameObject on its map.
String getFaceName()
Returns the name of the face of this Archetype or GameObject.
Reflects a game object (object on a map).
void addObjectText(@NotNull String line)
Appends.
int getEditType()
Returns the edit type.
Abstract factory for creating GameObject instances.
void visit(@NotNull BaseObjectVisitor< G, A, R > baseObjectVisitor)
Calls the appropriate.
int getSizeX()
Determines the horizontal extent in squares.
String DIRECTION
The attribute name of the object's direction.
String getAnimName()
DaiEditor only: Returns the name of the animation.
int getMaxY()
Determines the maximum y-coordinate of any part relative to the head part.
int getMapY()
Returns the Y coordinate of this GameObject on its map.
int getMinX()
Determines the minimum x-coordinate of any part relative to the head part.
String HP
The attribute name of the "hp" attribute.
String getLoreText()
Returns the map lore.
GameObjects are the objects based on Archetypes found on maps.
boolean usesDirection()
Return whether this base object uses the "direction" attribute.
void setObjectFace()
We set here the real face of the objects, depending on the set face and the set animation.
void setEditType(int editType)
Sets the edit type.
long getAttributeLong(@NotNull String attributeName, boolean queryArchetype)
Returns the requested attribute value of this GameObject as.
String getMsgText()
Returns the message bound to this object.
G newInstance(@NotNull GameObjectFactory< G, A, R > gameObjectFactory)
Creates a new GameObject instance: an Archetype is instantiated, a GameObject is cloned.
Point getMapLocation()
Returns the coordinate of this GameObject on its map.
void setMapY(int mapY)
Sets the Y coordinate of this GameObject on its map.
void addTailPart(@NotNull T tail)
Appends a tail to this GameObject.
int countInvObjects()
Counts the number of all inventory items (recursively).
int getAttributeInt(@NotNull String attributeName, boolean queryArchetype)
Returns the requested attribute value of this GameObject as.
void setObjectText(@NotNull String objectText)
Sets.
R getArchetype()
Returns the Archetype this GameObject is based on.
String getBestName()
Returns the name which is best appropriate to describe this GameObject.
T clone()
Creates a clone of this base object.
boolean isHead()
Returns whether this object is a single-part object or the head of the multi-part object...
void notifyBeginChange()
Notifies the map model that this container is about to change.
String IS_ANIMATED
The attribute name of the "is_animated" flag.
String toString(@NotNull String format)
Returns a string representation of this game object.
void setMulti(@NotNull MultiArchData< G, A, R, T > multi)
String SP
The attribute name of the "sp" attribute.
String NAME
The attribute name of the object's name.
boolean isEqual(@NotNull BaseObject<?, ?, ?, ?> gameObject)
Compares this object to another game object.
int getDirection()
Returns the direction of this Archetype or GameObject.
boolean isTail()
Determines if this part is a tail part.
boolean isDefaultGameObject()
Returns whether this game object is unmodified from its underlying archetype.
String getObjectText()
Returns the object text of this GameObject as String.
boolean isMulti()
Returns whether this Archetype is a multi-part object.
String BLOCKSVIEW
The name of the "blocksview" attribute.
int getMinY()
Determines the minimum y-coordinate of any part relative to the head part.
String TITLE
The attribute name of the object's title.
void removeTailParts()
Removes all tail parts of this game object.
double getAttributeDouble(@NotNull String attributeName, boolean queryArchetype)
Returns the requested attribute value of this GameObject as.
Interface for MapArchObjects.
int getTypeNo()
Returns the type number of this Archetype.
Class related to GameObject to store multi-part information.
void setAttributeString(@NotNull String attributeName, @NotNull String value)
Sets the String of an archetype attribute in the objectText.
String NO_PICK
The name of the "no_pick" attribute.