20 package net.sf.gridarta.model.archetype;
31 import org.jetbrains.annotations.NotNull;
32 import org.jetbrains.annotations.Nullable;
38 public abstract class AbstractArchetype<G
extends GameObject<G, A, R>, A extends
MapArchObject<A>, R extends
Archetype<G, A, R>> extends
AbstractBaseObject<G, A, R, R> implements
Archetype<G, A, R> {
110 super(faceObjectProviders, animationObjects);
111 this.archetypeName = archetypeName.intern();
123 public String
getAttributeString(@NotNull
final String attributeName,
final boolean queryArchetype) {
125 return result == null ?
"" : result;
131 final String normalizedFaceName = faceName.isEmpty() ? null : faceName.intern();
134 return normalizedFaceName != null && !normalizedFaceName.isEmpty() ? normalizedFaceName : null;
169 @SuppressWarnings(
"unchecked")
185 return gameObjectFactory.createGameObject(
getThis());
190 baseObjectVisitor.visit(
this);
String faceName
The name of the face.
int multiPartNr
The multi part id.
void setEditorFolder(@Nullable final String editorFolder)
abstract T getThis()
Returns.
void setMultiX(final int multiX)
Gridarta can handle frame information of animations and allow the selection of an animation using a t...
void notifyTransientChange()
NoopMethodInAbstractClass
void setLowestPart(final boolean isLowestPart)
MultiArchData< G, A, R, T > getMulti()
Returns the MultiArchData for this base object.
int multiX
The x-distance of this part to the head part.
void setMultiShapeID(final int multiShapeID)
String archetypeName
The name of this archetype.
boolean artifact
If this flag is set, this Archetype is not a "real" Archetype but comes from the artifacts file...
Base package of all Gridarta classes.
MapSquare< G, A, R > getMapSquare()
Reflects a game object (object on a map).
Abstract factory for creating GameObject instances.
int multiY
The y-distance of this part to the head part.
void setMultiPartNr(final int multiPartNr)
final AnimationObjects animationObjects
The AnimationObjects for looking up animations.
AnimationObjects is a container for AnimationObjects.
void notifyEndChange()
NoopMethodInAbstractClass
void notifyBeginChange()
NoopMethodInAbstractClass
GameObjects are the objects based on Archetypes found on maps.
String getEffectiveFaceName(@NotNull final String faceName)
void setArchetypeName(@NotNull final String archetypeName)
G newInstance(@NotNull final GameObjectFactory< G, A, R > gameObjectFactory)
int multiShapeID
The multi shape id.
void setMultiY(final int multiY)
Provider for faces of GameObjects and Archetypes.
The face is the appearance of an object.
static final long serialVersionUID
The serial version UID.
void visit(@NotNull final BaseObjectVisitor< G, A, R > baseObjectVisitor)
Default implementation for GameObject implementing classes.
final transient FaceObjectProviders faceObjectProviders
The FaceObjectProviders for looking up faces.
String getAttributeString(@NotNull final String attributeName, final boolean queryArchetype)
String getAttributeValue(@NotNull final String attributeName)
Returns an attribute value by attribute name.
MultiArchData< G, A, R, T > multi
Data for multi-part objects.
Abstract base class for Archetype implementations.
void updateArchetype()
Called whenever getArchetype() has changed.
String editorFolder
The location in the archetype selector.
String getArchetypeName()
Interface for MapArchObjects.
AbstractArchetype(@NotNull final String archetypeName, @NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects)
Creates a new instance.
void setMultiShapeID(final int multiShapeID)
Set the shape ID of this object.
Class related to GameObject to store multi-part information.