Gridarta Editor
GameObjectCreator.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.var.crossfire.model.gameobject;
21 
30 import org.jetbrains.annotations.NotNull;
31 
36 public class GameObjectCreator {
37 
41  @NotNull
42  private final Archetype archetype;
43 
47  @NotNull
49 
53  @NotNull
55 
59  public GameObjectCreator() {
60  final FaceObjects faceObjects = new DefaultFaceObjects(false);
61  final ResourceIcons resourceIcons = new ResourceIcons();
62  faceObjectProviders = new FaceObjectProviders(1, faceObjects, resourceIcons);
65  }
66 
72  @NotNull
73  public GameObject newGameObject(final int elevation) {
75  if (elevation != 0) {
76  gameObject.setAttributeInt(GameObject.ELEVATION, elevation);
77  }
78  return gameObject;
79  }
80 
81 }
net.sf.gridarta.var.crossfire.model.gameobject.GameObjectCreator.archetype
final Archetype archetype
The Archetype for created game objects.
Definition: GameObjectCreator.java:42
net.sf.gridarta.var.crossfire.model.archetype
Definition: Archetype.java:20
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
net.sf.gridarta.model.face.DefaultFaceObjects
Abstract base implementation of FaceObjects.
Definition: DefaultFaceObjects.java:50
net.sf.gridarta.model.face.FaceObjectProviders
Provider for faces of GameObjects and Archetypes.
Definition: FaceObjectProviders.java:46
net.sf.gridarta.var
net
net.sf.gridarta.var.crossfire.model.archetype.Archetype
Implements Crossfire archetypes.
Definition: Archetype.java:30
net.sf.gridarta.var.crossfire.model.gameobject.GameObject.ELEVATION
static final String ELEVATION
The name of the "elevation" attribute.
Definition: GameObject.java:52
net.sf.gridarta.var.crossfire
Main package of Gridarta4Crossfire, contains all classes specific to the Crossfire version of the Gri...
net.sf.gridarta.var.crossfire.model.gameobject.GameObjectCreator.GameObjectCreator
GameObjectCreator()
Creates a new instance.
Definition: GameObjectCreator.java:59
net.sf.gridarta.var.crossfire.model
net.sf.gridarta.model.face.FaceObjects
FaceObjects is a container for FaceObjects.
Definition: FaceObjects.java:31
net.sf.gridarta.var.crossfire.model.archetype.DefaultArchetype
An Atrinik Archetype.
Definition: DefaultArchetype.java:33
net.sf.gridarta.model.baseobject.AbstractBaseObject.setAttributeInt
void setAttributeInt(@NotNull final String attributeName, final int value)
Definition: AbstractBaseObject.java:324
net.sf.gridarta.model
net.sf.gridarta.var.crossfire.model.gameobject.GameObjectCreator
Creates GameObjects.
Definition: GameObjectCreator.java:36
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.var.crossfire.model.gameobject.GameObject
Handles the Crossfire GameObjects.
Definition: GameObject.java:41
net.sf.gridarta.utils.ResourceIcons
Creates ImageIcon instances from resources.
Definition: ResourceIcons.java:46
net.sf.gridarta.model.anim.DefaultAnimationObjects
Abstract base implementation of AnimationObjects.
Definition: DefaultAnimationObjects.java:31
net.sf.gridarta.var.crossfire.model.gameobject.GameObjectCreator.newGameObject
GameObject newGameObject(final int elevation)
Creates a new GameObject.
Definition: GameObjectCreator.java:73
net.sf.gridarta.utils
Definition: ActionBuilderUtils.java:20
net.sf.gridarta.var.crossfire.model.gameobject.GameObjectCreator.animationObjects
final AnimationObjects animationObjects
The AnimationObjects for created game objects.
Definition: GameObjectCreator.java:54
net.sf.gridarta.var.crossfire.model.gameobject.GameObjectCreator.faceObjectProviders
final FaceObjectProviders faceObjectProviders
The FaceObjectProviders for created game objects.
Definition: GameObjectCreator.java:48