Gridarta Editor
BaseObject.java
Go to the documentation of this file.
1 /*
2  * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games.
3  * Copyright (C) 2000-2023 The Gridarta Developers.
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 package net.sf.gridarta.model.baseobject;
21 
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;
33 
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 {
35 
36  int EDIT_TYPE_NONE = 0x10000; // special case
37 
41  @NotNull
42  String ANIMATION = "animation";
43 
47  @NotNull
48  String DIRECTION = "direction";
49 
53  @NotNull
54  String FACE = "face";
55 
59  @NotNull
60  String NAME = "name";
61 
65  @NotNull
66  String TYPE = "type";
67 
71  @NotNull
72  String TITLE = "title";
73 
77  @NotNull
78  String IS_ANIMATED = "is_animated";
79 
83  @NotNull
84  String IS_TURNABLE = "is_turnable";
85 
89  @NotNull
90  String HP = "hp";
91 
95  @NotNull
96  String SP = "sp";
97 
101  @NotNull
102  String NO_PASS = "no_pass";
103 
107  @NotNull
108  String NO_PICK = "no_pick";
109 
113  @NotNull
114  String LEVEL = "level";
115 
119  @NotNull
120  String SLAYING = "slaying";
121 
125  @NotNull
126  String LAST_HEAL = "last_heal";
127 
131  @NotNull
132  String BLOCKSVIEW = "blocksview";
133 
137  @NotNull
138  String ANIM_SPEED = "anim_speed";
139 
144  int getTypeNo();
145 
150  @Nullable
151  String getFaceName();
152 
158  int countInvObjects();
159 
168  boolean hasAttribute(@NotNull String attributeName, boolean queryArchetype);
169 
186  @NotNull
187  String getAttributeString(@NotNull String attributeName, boolean queryArchetype);
188 
197  int getAttributeInt(@NotNull String attributeName, boolean queryArchetype);
198 
208  long getAttributeLong(@NotNull String attributeName, boolean queryArchetype);
209 
219  double getAttributeDouble(@NotNull String attributeName, boolean queryArchetype);
220 
226  void setAttributeString(@NotNull String attributeName, @NotNull String value);
227 
231  void notifyBeginChange();
232 
236  void notifyEndChange();
237 
242  void notifyTransientChange();
243 
249  @NotNull
250  R getArchetype();
251 
256  int getEditType();
257 
262  void setEditType(int editType);
263 
269  void addMsgTextLine(@NotNull String text);
270 
280  @Nullable
281  String getMsgText(boolean queryArchetype);
282 
287  void setMsgText(@Nullable String msgText);
288 
297  int getMapX();
298 
307  int getMapY();
308 
316  @NotNull
317  Point getMapLocation();
318 
324  void setMapX(int mapX);
325 
331  void setMapY(int mapY);
332 
339  boolean isHead();
340 
346  @Nullable
347  T getMultiNext();
348 
356  int getMultiRefCount();
357 
362  void addTailPart(@NotNull T tail);
363 
368  void removeTailParts();
369 
375  T getHead();
376 
382  boolean isTail();
383 
389  int getSizeX();
390 
396  int getSizeY();
397 
403  int getMaxX();
404 
410  int getMaxY();
411 
417  int getMinX();
418 
424  int getMinY();
425 
430  @NotNull
431  String getObjName();
432 
438  @NotNull
439  String getBestName();
440 
445  @NotNull
446  String getObjectText();
447 
453  void addObjectText(@NotNull String line);
454 
459  void setObjectText(@NotNull String objectText);
460 
466  boolean isDefaultGameObject();
467 
473  boolean isEqual(@NotNull BaseObject<?, ?, ?, ?> gameObject);
474 
479  int getDirection();
480 
485  @NotNull
487 
492  @Nullable
493  String getAnimName();
494 
500  boolean isMulti();
501 
502  void setMulti(@NotNull MultiArchData<G, A, R, T> multi);
503 
508  @Nullable
509  String getFaceObjName();
510 
518  void setObjectFace();
519 
524  @NotNull
525  ImageIcon getNormalImage();
526 
530  @NotNull
531  T clone();
532 
537  @NotNull
538  String getLoreText();
539 
544  void setLoreText(@NotNull CharSequence loreText);
545 
553  @NotNull
554  G newInstance(@NotNull GameObjectFactory<G, A, R> gameObjectFactory);
555 
561  void visit(@NotNull BaseObjectVisitor<G, A, R> baseObjectVisitor);
562 
567  boolean usesDirection();
568 
572  void facesReloaded();
573 
588  @NotNull
589  String toString(@NotNull String format);
590 
591 }
net.sf.gridarta.model.baseobject.BaseObject.EDIT_TYPE_NONE
int EDIT_TYPE_NONE
Definition: BaseObject.java:36
net.sf.gridarta.model.baseobject.BaseObject.setLoreText
void setLoreText(@NotNull CharSequence loreText)
net.sf.gridarta.model.baseobject.BaseObject.newInstance
G newInstance(@NotNull GameObjectFactory< G, A, R > gameObjectFactory)
net.sf.gridarta.model.baseobject.BaseObject.getHead
T getHead()
net.sf.gridarta.model.baseobject.Attributes
Definition: Attributes.java:28
net.sf.gridarta.model.baseobject.BaseObject.NAME
String NAME
Definition: BaseObject.java:60
net.sf.gridarta.model.baseobject.BaseObject.DIRECTION
String DIRECTION
Definition: BaseObject.java:48
net.sf.gridarta.model.baseobject.BaseObject.getFaceName
String getFaceName()
net.sf.gridarta.model.baseobject.BaseObject.getAttributeInt
int getAttributeInt(@NotNull String attributeName, boolean queryArchetype)
net.sf.gridarta.model.baseobject.BaseObject.getMapLocation
Point getMapLocation()
net.sf.gridarta.model.baseobject.BaseObject.getSizeX
int getSizeX()
net.sf.gridarta
net.sf.gridarta.model.baseobject.BaseObject.isTail
boolean isTail()
net.sf.gridarta.model.baseobject.BaseObject.getAttributeDouble
double getAttributeDouble(@NotNull String attributeName, boolean queryArchetype)
net.sf.gridarta.model.baseobject.BaseObject.isEqual
boolean isEqual(@NotNull BaseObject<?, ?, ?, ?> gameObject)
net.sf.gridarta.model.baseobject.BaseObject.setObjectText
void setObjectText(@NotNull String objectText)
net.sf.gridarta.model.baseobject.BaseObject.getMaxY
int getMaxY()
net.sf.gridarta.model.maparchobject.MapArchObject
Definition: MapArchObject.java:40
net.sf.gridarta.model.baseobject.BaseObject.getAttributeLong
long getAttributeLong(@NotNull String attributeName, boolean queryArchetype)
net.sf.gridarta.model.baseobject.BaseObject.getObjName
String getObjName()
net.sf.gridarta.model.baseobject.BaseObject.visit
void visit(@NotNull BaseObjectVisitor< G, A, R > baseObjectVisitor)
net.sf.gridarta.model.baseobject.BaseObject.setEditType
void setEditType(int editType)
net.sf
net.sf.gridarta.model.baseobject.BaseObject.getMinX
int getMinX()
net.sf.gridarta.model.baseobject.BaseObject.getMultiRefCount
int getMultiRefCount()
net.sf.gridarta.model.baseobject.BaseObject.isMulti
boolean isMulti()
net.sf.gridarta.model.baseobject.BaseObject.getMapY
int getMapY()
net.sf.gridarta.model.baseobject.BaseObject.LEVEL
String LEVEL
Definition: BaseObject.java:114
net.sf.gridarta.model.baseobject.BaseObject.FACE
String FACE
Definition: BaseObject.java:54
net.sf.gridarta.model.baseobject.BaseObject.getTypeNo
int getTypeNo()
net.sf.gridarta.model.baseobject.BaseObject
Definition: BaseObject.java:34
net.sf.gridarta.model.baseobject.BaseObject.IS_ANIMATED
String IS_ANIMATED
Definition: BaseObject.java:78
net.sf.gridarta.model.archetype
Definition: AbstractArchetype.java:20
net.sf.gridarta.model.baseobject.BaseObject.getSizeY
int getSizeY()
net.sf.gridarta.model.baseobject.BaseObject.getMultiNext
T getMultiNext()
net.sf.gridarta.model.baseobject.BaseObject.hasAttribute
boolean hasAttribute(@NotNull String attributeName, boolean queryArchetype)
net.sf.gridarta.model.baseobject.BaseObject.clone
T clone()
net.sf.gridarta.model.baseobject.BaseObject.LAST_HEAL
String LAST_HEAL
Definition: BaseObject.java:126
net.sf.gridarta.model.gameobject.GameObject
Definition: GameObject.java:36
net.sf.gridarta.model.baseobject.BaseObject.getMapX
int getMapX()
net.sf.gridarta.model.baseobject.BaseObject.getEditType
int getEditType()
net.sf.gridarta.model.baseobject.BaseObject.notifyEndChange
void notifyEndChange()
net.sf.gridarta.model.baseobject.BaseObject.setMapX
void setMapX(int mapX)
net.sf.gridarta.model.gameobject.GameObjectFactory
Definition: GameObjectFactory.java:31
net.sf.gridarta.model.gameobject.MultiArchData
Definition: MultiArchData.java:41
net.sf.gridarta.model.baseobject.BaseObject.notifyBeginChange
void notifyBeginChange()
net.sf.gridarta.model.gameobject
Definition: AbstractGameObject.java:20
net
net.sf.gridarta.model.baseobject.BaseObjectVisitor
Definition: BaseObjectVisitor.java:27
net.sf.gridarta.model.baseobject.BaseObject.SP
String SP
Definition: BaseObject.java:96
net.sf.gridarta.model.baseobject.BaseObject.TYPE
String TYPE
Definition: BaseObject.java:66
net.sf.gridarta.model.baseobject.BaseObject.TITLE
String TITLE
Definition: BaseObject.java:72
net.sf.gridarta.model.baseobject.BaseObject.addMsgTextLine
void addMsgTextLine(@NotNull String text)
net.sf.gridarta.model.baseobject.BaseObject.HP
String HP
Definition: BaseObject.java:90
net.sf.gridarta.model.baseobject.BaseObject.getMsgText
String getMsgText(boolean queryArchetype)
net.sf.gridarta.model.baseobject.BaseObject.NO_PASS
String NO_PASS
Definition: BaseObject.java:102
net.sf.gridarta.model.baseobject.BaseObject.getMaxX
int getMaxX()
net.sf.gridarta.model.baseobject.BaseObject.notifyTransientChange
void notifyTransientChange()
net.sf.gridarta.model.baseobject.BaseObject.setMulti
void setMulti(@NotNull MultiArchData< G, A, R, T > multi)
net.sf.gridarta.model.gameobject.FaceSource
Definition: FaceSource.java:28
net.sf.gridarta.model.baseobject.BaseObject.setAttributeString
void setAttributeString(@NotNull String attributeName, @NotNull String value)
net.sf.gridarta.model.baseobject.BaseObject.getAttributeString
String getAttributeString(@NotNull String attributeName, boolean queryArchetype)
net.sf.gridarta.model.baseobject.BaseObject.getMinY
int getMinY()
net.sf.gridarta.model.baseobject.BaseObject.toString
String toString(@NotNull String format)
net.sf.gridarta.model.baseobject.BaseObject.getAnimName
String getAnimName()
net.sf.gridarta.model.baseobject.BaseObject.addObjectText
void addObjectText(@NotNull String line)
net.sf.gridarta.model.baseobject.BaseObject.getObjectText
String getObjectText()
net.sf.gridarta.model.baseobject.BaseObject.getNormalImage
ImageIcon getNormalImage()
net.sf.gridarta.model.baseobject.BaseObject.setMapY
void setMapY(int mapY)
net.sf.gridarta.model.baseobject.BaseObject.addTailPart
void addTailPart(@NotNull T tail)
net.sf.gridarta.model.baseobject.BaseObject.ANIM_SPEED
String ANIM_SPEED
Definition: BaseObject.java:138
net.sf.gridarta.model.baseobject.BaseObject.getLoreText
String getLoreText()
net.sf.gridarta.model
net.sf.gridarta.model.baseobject.BaseObject.setObjectFace
void setObjectFace()
net.sf.gridarta.model.baseobject.BaseObject.getDirection
int getDirection()
net.sf.gridarta.model.baseobject.BaseObject.getFaceObjName
String getFaceObjName()
net.sf.gridarta.model.baseobject.BaseObject.facesReloaded
void facesReloaded()
net.sf.gridarta.model.baseobject.BaseObject.SLAYING
String SLAYING
Definition: BaseObject.java:120
net.sf.gridarta.model.maparchobject
Definition: AbstractMapArchObject.java:20
net.sf.gridarta.model.baseobject.BaseObject.getArchetype
R getArchetype()
net.sf.gridarta.model.baseobject.BaseObject.BLOCKSVIEW
String BLOCKSVIEW
Definition: BaseObject.java:132
net.sf.gridarta.model.baseobject.BaseObject.NO_PICK
String NO_PICK
Definition: BaseObject.java:108
net.sf.gridarta.model.baseobject.BaseObject.isDefaultGameObject
boolean isDefaultGameObject()
net.sf.gridarta.model.baseobject.BaseObject.getFaceObjSource
FaceSource getFaceObjSource()
net.sf.gridarta.model.baseobject.BaseObject.setMsgText
void setMsgText(@Nullable String msgText)
net.sf.gridarta.model.baseobject.BaseObject.countInvObjects
int countInvObjects()
net.sf.gridarta.model.baseobject.BaseObject.IS_TURNABLE
String IS_TURNABLE
Definition: BaseObject.java:84
net.sf.gridarta.model.archetype.Archetype
Definition: Archetype.java:41
net.sf.gridarta.model.baseobject.BaseObject.isHead
boolean isHead()
net.sf.gridarta.model.baseobject.BaseObject.usesDirection
boolean usesDirection()
net.sf.gridarta.model.baseobject.BaseObject.getBestName
String getBestName()
net.sf.gridarta.model.baseobject.BaseObject.ANIMATION
String ANIMATION
Definition: BaseObject.java:42
net.sf.gridarta.model.baseobject.BaseObject.removeTailParts
void removeTailParts()