Gridarta Editor
TestGameObject.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.gameobject;
21 
27 import org.jetbrains.annotations.NotNull;
28 import org.jetbrains.annotations.Nullable;
29 
34 public class TestGameObject extends DefaultIsoGameObject<TestGameObject, TestMapArchObject, TestArchetype> {
35 
39  private static final long serialVersionUID = 1L;
40 
44  @NotNull
45  public static final String ELEVATION = "test_elevation";
46 
54  public TestGameObject(@NotNull final TestArchetype archetype, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects) {
55  super(archetype, faceObjectProviders, animationObjects);
56  }
57 
58  @Override
59  public boolean isDrawDouble(final boolean drawDoubleFaces) {
60  return drawDoubleFaces;
61  }
62 
63  @Override
64  public boolean isStretched(final boolean tileStretching) {
65  return false;
66  }
67 
68  @Override
69  public int getLightRadius() {
70  return 0;
71  }
72 
73  @Override
74  public void propagateElevation(@NotNull final BaseObject<?, ?, ?, ?> gameObject) {
75  final int elevation = gameObject.getAttributeInt(ELEVATION, false);
76  setAttributeInt(ELEVATION, elevation);
77  gameObject.removeAttribute(ELEVATION);
78  }
79 
80  @Override
81  public void updateTileStretch(final int heightValue, final boolean isAbsolute, @NotNull final Integer @Nullable [] subLayers) {
82  // ignore
83  }
84 
85  @Override
86  public void applyMassChange(@NotNull final Integer @NotNull [] layers, @NotNull final Integer @NotNull [] subLayers, @NotNull final String changes) {
87  }
88 
89  @Override
90  public boolean isScripted() {
91  throw new AssertionError();
92  }
93 
94  @NotNull
95  @Override
96  public TestGameObject clone() {
97  return super.clone();
98  }
99 
100  @NotNull
101  @Override
102  protected TestGameObject getThis() {
103  return this;
104  }
105 
106 }
net.sf.gridarta.model.archetype.TestArchetype
An Archetype implementation for testing purposes.
Definition: TestArchetype.java:30
net.sf.gridarta.model.gameobject.DefaultIsoGameObject
Default implementation for GameObject implementing classes.
Definition: DefaultIsoGameObject.java:38
net.sf.gridarta
Base package of all Gridarta classes.
net.sf.gridarta.model.anim.AnimationObjects
AnimationObjects is a container for AnimationObjects.
Definition: AnimationObjects.java:30
net.sf.gridarta.model.gameobject.TestGameObject
A GameObject implementation for testing purposes.
Definition: TestGameObject.java:34
net.sf.gridarta.model.gameobject.TestGameObject.propagateElevation
void propagateElevation(@NotNull final BaseObject<?, ?, ?, ?> gameObject)
Definition: TestGameObject.java:74
net.sf
net.sf.gridarta.model.archetype
Definition: AbstractArchetype.java:20
net.sf.gridarta.model.face.FaceObjectProviders
Provider for faces of GameObjects and Archetypes.
Definition: FaceObjectProviders.java:46
net.sf.gridarta.model.gameobject.TestGameObject.getLightRadius
int getLightRadius()
Definition: TestGameObject.java:69
net
net.sf.gridarta.model.gameobject.DefaultIsoGameObject< TestGameObject, TestMapArchObject, TestArchetype >::faceObjectProviders
final transient FaceObjectProviders faceObjectProviders
The FaceObjectProviders for looking up faces.
Definition: DefaultIsoGameObject.java:121
net.sf.gridarta.model.gameobject.TestGameObject.isScripted
boolean isScripted()
Definition: TestGameObject.java:90
net.sf.gridarta.model.gameobject.TestGameObject.isStretched
boolean isStretched(final boolean tileStretching)
Definition: TestGameObject.java:64
net.sf.gridarta.model.gameobject.TestGameObject.getThis
TestGameObject getThis()
Definition: TestGameObject.java:102
net.sf.gridarta.model.gameobject.TestGameObject.applyMassChange
void applyMassChange(@NotNull final Integer @NotNull[] layers, @NotNull final Integer @NotNull[] subLayers, @NotNull final String changes)
Definition: TestGameObject.java:86
net.sf.gridarta.model.gameobject.TestGameObject.clone
TestGameObject clone()
Definition: TestGameObject.java:96
net.sf.gridarta.model.gameobject.TestGameObject.TestGameObject
TestGameObject(@NotNull final TestArchetype archetype, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects)
Creates a new instance.
Definition: TestGameObject.java:54
net.sf.gridarta.model.gameobject.TestGameObject.updateTileStretch
void updateTileStretch(final int heightValue, final boolean isAbsolute, @NotNull final Integer @Nullable[] subLayers)
Definition: TestGameObject.java:81
net.sf.gridarta.model.baseobject.BaseObject
Definition: BaseObject.java:34
net.sf.gridarta.model
net.sf.gridarta.model.gameobject.TestGameObject.isDrawDouble
boolean isDrawDouble(final boolean drawDoubleFaces)
Definition: TestGameObject.java:59
net.sf.gridarta.model.gameobject.TestGameObject.ELEVATION
static final String ELEVATION
The name of the "elevation" attribute.
Definition: TestGameObject.java:45
net.sf.gridarta.model.baseobject
Definition: AbstractBaseObject.java:20
net.sf.gridarta.model.face
The face is the appearance of an object.
Definition: AbstractFaceObjects.java:20
net.sf.gridarta.model.anim
Gridarta can handle frame information of animations and allow the selection of an animation using a t...
Definition: AbstractAnimationObjects.java:20
net.sf.gridarta.model.maparchobject.TestMapArchObject
A MapArchObject implementation for testing purposes.
Definition: TestMapArchObject.java:28
net.sf.gridarta.model.maparchobject
Definition: AbstractMapArchObject.java:20
net.sf.gridarta.model.gameobject.TestGameObject.serialVersionUID
static final long serialVersionUID
The serial version UID.
Definition: TestGameObject.java:39