|
Gridarta Editor
|
Default implementation for GameObject implementing classes. More...
Inheritance diagram for net.sf.gridarta.model.gameobject.DefaultIsoGameObject< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:
Collaboration diagram for net.sf.gridarta.model.gameobject.DefaultIsoGameObject< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >:Public Member Functions | |
| G | clone () |
| void | facesReloaded () |
| Icon | getDoubleImage () |
| Returns a double variant of the face for this GameObject. More... | |
| Icon | getStretchedImage (final long stretchFactor) |
| Returns a stretched variant of the face for this floor-type GameObject. More... | |
| final long | getStretchFactor () |
| Acquire stretch factor of the object. More... | |
| Icon | getTransparentDoubleImage () |
| Returns a transparent variant of the face for this GameObject. More... | |
| Icon | getTransparentImage () |
| Returns a transparent variant of the face for this GameObject. More... | |
| final int | getYOffset () |
| Acquire Y offset of the object for rendering purposes. More... | |
| abstract boolean | isDrawDouble (boolean drawDoubleFaces) |
| Returns whether to draw this game object with double height. More... | |
| boolean | isEqual (@NotNull final BaseObject<?, ?, ?, ?> gameObject) |
| abstract boolean | isStretched (boolean tileStretching) |
| Returns whether to draw this game object with stretching transformation. More... | |
| final void | refreshStretchFactor () |
| Invalidates stretch factor value calculated by getStretchFactor() and clears the stored stretched face. More... | |
| void | setObjectFace () |
| boolean | usesDirection () |
Public Member Functions inherited from net.sf.gridarta.model.gameobject.AbstractGameObject< G, A, R > | |
| G | asGameObject () |
| G | clone () |
| R | getArchetype () |
| String | getAttributeString ( @NotNull final String attributeName, final boolean queryArchetype) |
| GameObjectContainer< G, A, R > | getContainer () |
| G | getContainerGameObject () |
| MapSquare< G, A, R > | getMapSquare () |
| G | getNext () |
| G | getPrev () |
| G | getTopContainer () |
| boolean | hasUndefinedArchetype () |
| void | insertAfter ( @NotNull final G node) |
| void | insertBefore ( @NotNull final G node) |
| boolean | isBottom () |
| boolean | isInContainer () |
| boolean | isTop () |
| void | markModified () |
| void | moveBottom () |
| void | moveDown () |
| void | moveTop () |
| void | moveUp () |
| G | newInstance ( @NotNull final GameObjectFactory< G, A, R > gameObjectFactory) |
| void | notifyBeginChange () |
| void | notifyEndChange () |
| void | notifyTransientChange () |
| void | remove () |
| void | setArchetype ( @NotNull final R archetype) |
| void | setContainer ( @Nullable final GameObjectContainer< G, A, R > container, final int mapX, final int mapY) |
| void | visit ( @NotNull final BaseObjectVisitor< G, A, R > baseObjectVisitor) |
Static Public Attributes | |
| static final String | ALIGN = "align" |
| The name of the "align" attribute. More... | |
| static final String | ALPHA = "alpha" |
| The name of the "alpha" attribute. More... | |
| static final String | DRAW_DOUBLE = "draw_double" |
| The name of the "draw_double" attribute. More... | |
| static final String | DRAW_DOUBLE_ALWAYS = "draw_double_always" |
| The name of the "draw_double_always" attribute. More... | |
| static final String | GLOW_RADIUS = "glow_radius" |
| The name of the "glow_radius" attribute. More... | |
| static final String | LAYER = "layer" |
| The name of the "layer" attribute. More... | |
| static final int | MAX_SUB_LAYERS = 7 |
| static final String | ROTATE = "rotate" |
| The name of the "rotate" attribute. More... | |
| static final String | SUB_LAYER = "sub_layer" |
| The name of the "sub_layer" attribute. More... | |
| static final String | SYS_OBJECT = "sys_object" |
| The name of the "sys_object" attribute. More... | |
| static final String | Z = "z" |
| The name of the "z" attribute. More... | |
| static final String | ZOOM = "zoom" |
| The name of the "zoom" attribute. More... | |
Protected Member Functions | |
| DefaultIsoGameObject (@NotNull final R archetype, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) | |
| Creates a new instance. More... | |
Protected Member Functions inherited from net.sf.gridarta.model.gameobject.AbstractGameObject< G, A, R > | |
| AbstractGameObject ( @NotNull final R archetype, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) | |
| Creates a new instance. More... | |
| String | getEffectiveFaceName ( @NotNull final String faceName) |
Private Member Functions | |
| int | getYFloorOffset (final int dx, final int dy) |
| Acquire Y offset at the specified coordinates, relative to the game object's coordinates and its sub-layer. More... | |
Private Attributes | |
| ImageIcon | doubleFace |
| The double face. More... | |
| final transient FaceObjectProviders | faceObjectProviders |
| The FaceObjectProviders for looking up faces. More... | |
| final Point | point = new Point() |
| Cached point to avoid unnecessary allocations. More... | |
| ImageIcon | stretchedFace |
| The stretched floor face. More... | |
| long | stretchFactor |
| Calculated stretch factor. More... | |
| boolean | stretchFactorIsValid |
| If true, the stored stretchFactor is valid and can be used in getStretchFactor() instead of calculating a new one. More... | |
| ImageIcon | transDoubleFace |
| The transparent double face. More... | |
| ImageIcon | transFace |
| The transparent face. More... | |
Static Private Attributes | |
| static final int | MAX_STRETCH = 8 |
| static final int | MAX_STRETCH_DIAGONAL = 12 |
| static final long | serialVersionUID = 1L |
| The serial version UID. More... | |
Default implementation for GameObject implementing classes.
Definition at line 38 of file DefaultIsoGameObject.java.
|
protected |
Creates a new instance.
| archetype | the base archetype |
| faceObjectProviders | the face object providers for looking up faces |
| animationObjects | the animation objects for looking up animations |
Definition at line 175 of file DefaultIsoGameObject.java.
| G net.sf.gridarta.model.gameobject.DefaultIsoGameObject< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.clone | ( | ) |
Definition at line 430 of file DefaultIsoGameObject.java.
Referenced by net.sf.gridarta.model.gameobject.DefaultIsoGameObject< TestGameObject, TestMapArchObject, TestArchetype >.clone().
Here is the caller graph for this function:| void net.sf.gridarta.model.gameobject.DefaultIsoGameObject< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.facesReloaded | ( | ) |
Definition at line 444 of file DefaultIsoGameObject.java.
| Icon net.sf.gridarta.model.gameobject.DefaultIsoGameObject< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getDoubleImage | ( | ) |
Returns a double variant of the face for this GameObject.
Definition at line 211 of file DefaultIsoGameObject.java.
| Icon net.sf.gridarta.model.gameobject.DefaultIsoGameObject< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getStretchedImage | ( | final long | stretchFactor | ) |
Returns a stretched variant of the face for this floor-type GameObject.
Definition at line 404 of file DefaultIsoGameObject.java.
| final long net.sf.gridarta.model.gameobject.DefaultIsoGameObject< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getStretchFactor | ( | ) |
Acquire stretch factor of the object.
As the calculation is costly, the value will be stored until the next call to refreshStretchFactor()
Definition at line 282 of file DefaultIsoGameObject.java.
| Icon net.sf.gridarta.model.gameobject.DefaultIsoGameObject< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getTransparentDoubleImage | ( | ) |
Returns a transparent variant of the face for this GameObject.
Definition at line 223 of file DefaultIsoGameObject.java.
| Icon net.sf.gridarta.model.gameobject.DefaultIsoGameObject< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getTransparentImage | ( | ) |
Returns a transparent variant of the face for this GameObject.
Definition at line 199 of file DefaultIsoGameObject.java.
|
private |
Acquire Y offset at the specified coordinates, relative to the game object's coordinates and its sub-layer.
| dx | relative X coordinate |
| dy | relative Y coordinate |
Definition at line 245 of file DefaultIsoGameObject.java.
Referenced by net.sf.gridarta.model.gameobject.DefaultIsoGameObject< TestGameObject, TestMapArchObject, TestArchetype >.getStretchFactor().
Here is the caller graph for this function:| final int net.sf.gridarta.model.gameobject.DefaultIsoGameObject< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.getYOffset | ( | ) |
Acquire Y offset of the object for rendering purposes.
Definition at line 234 of file DefaultIsoGameObject.java.
|
abstract |
Returns whether to draw this game object with double height.
| drawDoubleFaces | whether the "draw double faces" map view setting is enabled |
Referenced by net.sf.gridarta.model.gameobject.DefaultIsoGameObject< TestGameObject, TestMapArchObject, TestArchetype >.getStretchedImage().
Here is the caller graph for this function:| boolean net.sf.gridarta.model.gameobject.DefaultIsoGameObject< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.isEqual | ( | @NotNull final BaseObject<?, ?, ?, ?> | gameObject | ) |
Definition at line 437 of file DefaultIsoGameObject.java.
|
abstract |
Returns whether to draw this game object with stretching transformation.
| tileStretching | whether the "tile-stretching" map view setting is enabled |
Referenced by net.sf.gridarta.model.gameobject.DefaultIsoGameObject< TestGameObject, TestMapArchObject, TestArchetype >.getStretchedImage().
Here is the caller graph for this function:| final void net.sf.gridarta.model.gameobject.DefaultIsoGameObject< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.refreshStretchFactor | ( | ) |
Invalidates stretch factor value calculated by getStretchFactor() and clears the stored stretched face.
Definition at line 271 of file DefaultIsoGameObject.java.
| void net.sf.gridarta.model.gameobject.DefaultIsoGameObject< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.setObjectFace | ( | ) |
Definition at line 186 of file DefaultIsoGameObject.java.
| boolean net.sf.gridarta.model.gameobject.DefaultIsoGameObject< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.usesDirection | ( | ) |
Definition at line 181 of file DefaultIsoGameObject.java.
|
static |
The name of the "align" attribute.
Definition at line 91 of file DefaultIsoGameObject.java.
Referenced by net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.paintGameObject(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintAlign1(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintAlign2(), and net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintCombined1().
|
static |
The name of the "alpha" attribute.
Definition at line 103 of file DefaultIsoGameObject.java.
Referenced by net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.paintGameObject().
|
private |
The double face.
Definition at line 135 of file DefaultIsoGameObject.java.
Referenced by net.sf.gridarta.model.gameobject.DefaultIsoGameObject< TestGameObject, TestMapArchObject, TestArchetype >.facesReloaded(), and net.sf.gridarta.model.gameobject.DefaultIsoGameObject< TestGameObject, TestMapArchObject, TestArchetype >.getDoubleImage().
|
static |
The name of the "draw_double" attribute.
Definition at line 85 of file DefaultIsoGameObject.java.
Referenced by net.sf.gridarta.var.atrinik.model.gameobject.GameObject.isDrawDouble().
|
static |
The name of the "draw_double_always" attribute.
Definition at line 79 of file DefaultIsoGameObject.java.
Referenced by net.sf.gridarta.var.atrinik.model.gameobject.GameObject.isDrawDouble().
|
private |
The FaceObjectProviders for looking up faces.
Definition at line 121 of file DefaultIsoGameObject.java.
Referenced by net.sf.gridarta.model.gameobject.DefaultIsoGameObject< TestGameObject, TestMapArchObject, TestArchetype >.DefaultIsoGameObject().
|
static |
The name of the "glow_radius" attribute.
Definition at line 115 of file DefaultIsoGameObject.java.
Referenced by net.sf.gridarta.var.daimonin.model.gameobject.GameObject.getLightRadius(), and net.sf.gridarta.var.atrinik.model.gameobject.GameObject.getLightRadius().
|
static |
The name of the "layer" attribute.
Definition at line 61 of file DefaultIsoGameObject.java.
Referenced by net.sf.gridarta.var.atrinik.model.gameobject.GameObject.applyMassChange(), net.sf.gridarta.model.validation.errors.SysObjectNotOnLayerZeroError< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.correct(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.getSquareLocationAt(), net.sf.gridarta.var.atrinik.model.gameobject.GameObject.isStretched(), net.sf.gridarta.gui.map.renderer.IsoPickmapRenderer< G extends DefaultIsoGameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.paintSquare(), net.sf.gridarta.gui.map.renderer.IsoMapRenderer< TestGameObject, TestMapArchObject, TestArchetype >.paintSquare(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.resizeFromModel(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintCombined1(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintZ1(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintZ2(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.tileStretchingOffsets(), net.sf.gridarta.model.validation.checks.SysObjectNotOnLayerZeroChecker< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.validateGameObject(), and net.sf.gridarta.model.validation.checks.DoubleLayerChecker< G extends GameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.validateSquare().
|
staticprivate |
Definition at line 45 of file DefaultIsoGameObject.java.
Referenced by net.sf.gridarta.model.gameobject.DefaultIsoGameObject< TestGameObject, TestMapArchObject, TestArchetype >.getStretchFactor().
|
staticprivate |
Definition at line 47 of file DefaultIsoGameObject.java.
Referenced by net.sf.gridarta.model.gameobject.DefaultIsoGameObject< TestGameObject, TestMapArchObject, TestArchetype >.getStretchFactor().
|
static |
Definition at line 49 of file DefaultIsoGameObject.java.
Referenced by net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.tileStretchingOffsets().
|
private |
Cached point to avoid unnecessary allocations.
Definition at line 155 of file DefaultIsoGameObject.java.
|
static |
The name of the "rotate" attribute.
Definition at line 109 of file DefaultIsoGameObject.java.
Referenced by net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.getRotate(), and net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintCombined1().
|
staticprivate |
The serial version UID.
Definition at line 43 of file DefaultIsoGameObject.java.
|
private |
The stretched floor face.
Definition at line 149 of file DefaultIsoGameObject.java.
Referenced by net.sf.gridarta.model.gameobject.DefaultIsoGameObject< TestGameObject, TestMapArchObject, TestArchetype >.facesReloaded(), and net.sf.gridarta.model.gameobject.DefaultIsoGameObject< TestGameObject, TestMapArchObject, TestArchetype >.getStretchedImage().
|
private |
Calculated stretch factor.
Definition at line 166 of file DefaultIsoGameObject.java.
Referenced by net.sf.gridarta.model.gameobject.DefaultIsoGameObject< TestGameObject, TestMapArchObject, TestArchetype >.getStretchFactor().
|
private |
If true, the stored stretchFactor is valid and can be used in getStretchFactor() instead of calculating a new one.
Definition at line 161 of file DefaultIsoGameObject.java.
|
static |
The name of the "sub_layer" attribute.
Definition at line 67 of file DefaultIsoGameObject.java.
Referenced by net.sf.gridarta.var.atrinik.model.gameobject.GameObject.applyMassChange(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.getSquareLocationAt(), net.sf.gridarta.gui.map.renderer.IsoPickmapRenderer< G extends DefaultIsoGameObject< G, A, R, A extends MapArchObject< A, R extends Archetype< G, A, R >.paintSquare(), net.sf.gridarta.gui.map.renderer.IsoMapRenderer< TestGameObject, TestMapArchObject, TestArchetype >.paintSquare(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.tileStretchingOffsets(), and net.sf.gridarta.var.atrinik.model.gameobject.GameObject.updateTileStretch().
|
static |
The name of the "sys_object" attribute.
Definition at line 73 of file DefaultIsoGameObject.java.
|
private |
The transparent double face.
Definition at line 142 of file DefaultIsoGameObject.java.
Referenced by net.sf.gridarta.model.gameobject.DefaultIsoGameObject< TestGameObject, TestMapArchObject, TestArchetype >.facesReloaded(), and net.sf.gridarta.model.gameobject.DefaultIsoGameObject< TestGameObject, TestMapArchObject, TestArchetype >.getTransparentDoubleImage().
|
private |
The transparent face.
Definition at line 128 of file DefaultIsoGameObject.java.
Referenced by net.sf.gridarta.model.gameobject.DefaultIsoGameObject< TestGameObject, TestMapArchObject, TestArchetype >.facesReloaded(), and net.sf.gridarta.model.gameobject.DefaultIsoGameObject< TestGameObject, TestMapArchObject, TestArchetype >.getTransparentImage().
|
static |
The name of the "z" attribute.
Definition at line 55 of file DefaultIsoGameObject.java.
Referenced by net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.resizeFromModel(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintCombined1(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintZ1(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintZ2(), net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.tileStretchingOffsets(), and net.sf.gridarta.var.atrinik.model.gameobject.GameObject.updateTileStretch().
|
static |
The name of the "zoom" attribute.
Definition at line 97 of file DefaultIsoGameObject.java.
Referenced by net.sf.gridarta.gui.map.renderer.AbstractIsoMapRenderer< G, A, R >.paintGameObject(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintCombined1(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintZoom1(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintZoom2(), net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintZoom3(), and net.sf.gridarta.var.atrinik.gui.map.renderer.MapRendererTest.testPaintZoom4().