Gridarta Editor
TestGameObjectFactory.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 TestGameObjectFactory extends AbstractGameObjectFactory<TestGameObject, TestMapArchObject, TestArchetype> {
35 
39  @NotNull
41 
45  @NotNull
47 
54  this.faceObjectProviders = faceObjectProviders;
55  this.animationObjects = animationObjects;
56  }
57 
58  @Override
59  @NotNull
60  public TestArchetype newArchetype(@NotNull final String archetypeName) {
61  return new TestDefaultArchetype(archetypeName, faceObjectProviders, animationObjects);
62  }
63 
64  @NotNull
65  @Override
66  public TestGameObject createGameObject(@NotNull final TestArchetype archetype) {
67  return createGameObjectPart(archetype, null);
68  }
69 
70  @NotNull
71  @Override
72  public TestGameObject createGameObjectPart(@NotNull final TestArchetype archetype, @Nullable final TestGameObject head) {
73  final TestGameObject gameObject = new TestGameObject(archetype, faceObjectProviders, animationObjects);
74  if (head != null) {
75  head.addTailPart(gameObject);
76  }
77  return gameObject;
78  }
79 
80  @NotNull
81  @Override
82  public TestGameObject cloneGameObject(@NotNull final TestGameObject gameObject) {
83  return gameObject.clone();
84  }
85 
86 }
net.sf.gridarta.model.archetype.TestArchetype
An Archetype implementation for testing purposes.
Definition: TestArchetype.java:30
net.sf.gridarta.model.archetype.TestDefaultArchetype
An Archetype implementation for testing purposes.
Definition: TestDefaultArchetype.java:32
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
net.sf.gridarta.model.archetype
Definition: AbstractArchetype.java:20
net.sf.gridarta.model.gameobject.TestGameObjectFactory.createGameObjectPart
TestGameObject createGameObjectPart(@NotNull final TestArchetype archetype, @Nullable final TestGameObject head)
Definition: TestGameObjectFactory.java:72
net.sf.gridarta.model.face.FaceObjectProviders
Provider for faces of GameObjects and Archetypes.
Definition: FaceObjectProviders.java:46
net.sf.gridarta.model.gameobject.TestGameObjectFactory.animationObjects
final AnimationObjects animationObjects
The AnimationObjects for looking up animations.
Definition: TestGameObjectFactory.java:46
net
net.sf.gridarta.model.gameobject.TestGameObjectFactory
A GameObjectFactory for regression tests.
Definition: TestGameObjectFactory.java:34
net.sf.gridarta.model.gameobject.TestGameObjectFactory.createGameObject
TestGameObject createGameObject(@NotNull final TestArchetype archetype)
Definition: TestGameObjectFactory.java:66
net.sf.gridarta.model.gameobject.TestGameObjectFactory.TestGameObjectFactory
TestGameObjectFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects)
Creates a new instance.
Definition: TestGameObjectFactory.java:53
net.sf.gridarta.model.gameobject.TestGameObject.clone
TestGameObject clone()
Definition: TestGameObject.java:96
net.sf.gridarta.model.gameobject.AbstractGameObjectFactory
Abstract base class for GameObjectFactory implementations.
Definition: AbstractGameObjectFactory.java:30
net.sf.gridarta.model.gameobject.TestGameObjectFactory.newArchetype
TestArchetype newArchetype(@NotNull final String archetypeName)
Definition: TestGameObjectFactory.java:60
net.sf.gridarta.model
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.TestGameObjectFactory.cloneGameObject
TestGameObject cloneGameObject(@NotNull final TestGameObject gameObject)
Definition: TestGameObjectFactory.java:82
net.sf.gridarta.model.gameobject.TestGameObjectFactory.faceObjectProviders
final FaceObjectProviders faceObjectProviders
The FaceObjectProviders to use.
Definition: TestGameObjectFactory.java:40