Gridarta Editor
src
model
src
test
java
net
sf
gridarta
model
gameobject
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
22
import
net
.
sf
.
gridarta
.
model
.
anim
.
AnimationObjects
;
23
import
net
.
sf
.
gridarta
.
model
.
archetype
.
TestArchetype
;
24
import
net
.
sf
.
gridarta
.
model
.
archetype
.
TestDefaultArchetype
;
25
import
net
.
sf
.
gridarta
.
model
.
face
.
FaceObjectProviders
;
26
import
net
.
sf
.
gridarta
.
model
.
maparchobject
.
TestMapArchObject
;
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
40
private
final
FaceObjectProviders
faceObjectProviders
;
41
45
@NotNull
46
private
final
AnimationObjects
animationObjects
;
47
53
public
TestGameObjectFactory
(@NotNull
final
FaceObjectProviders
faceObjectProviders
, @NotNull
final
AnimationObjects
animationObjects
) {
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.gameobject.TestGameObject
Definition:
TestGameObject.java:34
net.sf.gridarta.model.gameobject.AbstractGameObjectFactory
Definition:
AbstractGameObjectFactory.java:30
net.sf.gridarta
net.sf.gridarta.model.face.FaceObjectProviders
Definition:
FaceObjectProviders.java:46
net.sf.gridarta.model.archetype.TestArchetype
Definition:
TestArchetype.java:30
net.sf
net.sf.gridarta.model.gameobject.TestGameObjectFactory
Definition:
TestGameObjectFactory.java:34
net.sf.gridarta.model.anim.AnimationObjects
Definition:
AnimationObjects.java:30
net.sf.gridarta.model.archetype
Definition:
AbstractArchetype.java:20
net.sf.gridarta.model.gameobject.TestGameObjectFactory.faceObjectProviders
final FaceObjectProviders faceObjectProviders
Definition:
TestGameObjectFactory.java:40
net.sf.gridarta.model.gameobject.TestGameObjectFactory.newArchetype
TestArchetype newArchetype(@NotNull final String archetypeName)
Definition:
TestGameObjectFactory.java:60
net
net.sf.gridarta.model.gameobject.TestGameObjectFactory.animationObjects
final AnimationObjects animationObjects
Definition:
TestGameObjectFactory.java:46
net.sf.gridarta.model.gameobject.TestGameObject.clone
TestGameObject clone()
Definition:
TestGameObject.java:96
net.sf.gridarta.model.gameobject.TestGameObjectFactory.createGameObject
TestGameObject createGameObject(@NotNull final TestArchetype archetype)
Definition:
TestGameObjectFactory.java:66
net.sf.gridarta.model
net.sf.gridarta.model.face
Definition:
AbstractFaceObjects.java:20
net.sf.gridarta.model.anim
Definition:
AbstractAnimationObjects.java:20
net.sf.gridarta.model.maparchobject.TestMapArchObject
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.createGameObjectPart
TestGameObject createGameObjectPart(@NotNull final TestArchetype archetype, @Nullable final TestGameObject head)
Definition:
TestGameObjectFactory.java:72
net.sf.gridarta.model.archetype.TestDefaultArchetype
Definition:
TestDefaultArchetype.java:32
net.sf.gridarta.model.gameobject.TestGameObjectFactory.TestGameObjectFactory
TestGameObjectFactory(@NotNull final FaceObjectProviders faceObjectProviders, @NotNull final AnimationObjects animationObjects)
Definition:
TestGameObjectFactory.java:53
Generated by
1.8.17