net.sf.gridarta.model.mapmodel
public class TestMapModelHelper extends Object
MapModel
instances for regression tests.Modifier and Type | Field and Description |
---|---|
private static String[] |
EMPTY_STRING_ARRAY
An empty array of strings.
|
static int |
EXIT_TYPE
The archetype type used for "exit" game objects.
|
private TestArchetype |
exitArchetype
The archetype to create exit game objects.
|
private static int |
FLOOR_TYPE
The archetype type used for "floor" game objects.
|
private TestArchetype |
floorArchetype
The archetype to create floor game objects.
|
private GameObjectFactory<TestGameObject,TestMapArchObject,TestArchetype> |
gameObjectFactory
The
GameObjectFactory instance. |
private static int |
MOB_TYPE
The archetype type used for "mob" game objects.
|
private TestArchetype |
mob21Archetype
The archetype to create 2x1 mob game objects.
|
private InsertionMode<TestGameObject,TestMapArchObject,TestArchetype> |
topmostInsertionMode
The "topmost"
InsertionMode instance. |
Constructor and Description |
---|
TestMapModelHelper(InsertionMode<TestGameObject,TestMapArchObject,TestArchetype> topmostInsertionMode,
GameObjectFactory<TestGameObject,TestMapArchObject,TestArchetype> gameObjectFactory,
ArchetypeSet<TestGameObject,TestMapArchObject,TestArchetype> archetypeSet,
FaceObjectProviders faceObjectProviders,
AnimationObjects animationObjects)
Creates a new instance.
|
public static final int EXIT_TYPE
private static final int FLOOR_TYPE
private static final int MOB_TYPE
@NotNull private static final String[] EMPTY_STRING_ARRAY
@NotNull private final InsertionMode<TestGameObject,TestMapArchObject,TestArchetype> topmostInsertionMode
InsertionMode
instance.@NotNull private final GameObjectFactory<TestGameObject,TestMapArchObject,TestArchetype> gameObjectFactory
GameObjectFactory
instance.@NotNull private final TestArchetype floorArchetype
@NotNull private final TestArchetype exitArchetype
@NotNull private final TestArchetype mob21Archetype
public TestMapModelHelper(@NotNull InsertionMode<TestGameObject,TestMapArchObject,TestArchetype> topmostInsertionMode, @NotNull GameObjectFactory<TestGameObject,TestMapArchObject,TestArchetype> gameObjectFactory, @NotNull ArchetypeSet<TestGameObject,TestMapArchObject,TestArchetype> archetypeSet, @NotNull FaceObjectProviders faceObjectProviders, @NotNull AnimationObjects animationObjects) throws DuplicateArchetypeException
topmostInsertionMode
- the "topmost" insertion mode instancegameObjectFactory
- the game object factory to usearchetypeSet
- the archetype set to usefaceObjectProviders
- the face object providers to useanimationObjects
- the animation objects to useDuplicateArchetypeException
- if an internal error occurs@NotNull public TestGameObject insertFloor(@NotNull MapModel<TestGameObject,TestMapArchObject,TestArchetype> mapModel, @NotNull Point point) throws CannotInsertGameObjectException
floorArchetype
game object into a map model.mapModel
- the map model to insert intopoint
- the position to insert atCannotInsertGameObjectException
- if the archetype cannot be
inserted@NotNull public TestGameObject insertExit(@NotNull MapModel<TestGameObject,TestMapArchObject,TestArchetype> mapModel, @NotNull Point point) throws CannotInsertGameObjectException
exitArchetype
game object into a map model.mapModel
- the map model to insert intopoint
- the position to insert atCannotInsertGameObjectException
- if the archetype cannot be
inserted@NotNull public TestGameObject insertMob21(@NotNull MapModel<TestGameObject,TestMapArchObject,TestArchetype> mapModel, @NotNull Point point) throws CannotInsertGameObjectException
mob21Archetype
game object into a map model.mapModel
- the map model to insert intopoint
- the position to insert atCannotInsertGameObjectException
- if the archetype cannot be
inserted@NotNull public TestGameObject insertArchetype(@NotNull MapModel<TestGameObject,TestMapArchObject,TestArchetype> mapModel, int x, int y, @NotNull BaseObject<TestGameObject,TestMapArchObject,TestArchetype,?> archetype, boolean join) throws CannotInsertGameObjectException
mapModel
- the map model to insert intox
- the x coordinate to insert aty
- the y coordinate to insert atarchetype
- the archetype to insertjoin
- whether to perform autojoiningCannotInsertGameObjectException
- if the archetype cannot be
inserted@NotNull public TestGameObject insertArchetype(@NotNull MapModel<TestGameObject,TestMapArchObject,TestArchetype> mapModel, @NotNull Point point, @NotNull BaseObject<TestGameObject,TestMapArchObject,TestArchetype,?> archetype, boolean join) throws CannotInsertGameObjectException
mapModel
- the map model to insert intopoint
- the position to insert atarchetype
- the archetype to insertjoin
- whether to perform autojoiningCannotInsertGameObjectException
- if the archetype cannot be
inserted@NotNull public TestGameObject insertExit(@NotNull GameObjectContainer<TestGameObject,TestMapArchObject,TestArchetype> gameObject)
exitArchetype
game object into a game object.gameObject
- the game object@NotNull public TestGameObject insertMob21(@NotNull GameObjectContainer<TestGameObject,TestMapArchObject,TestArchetype> gameObject)
mob21Archetype
game object into a game object.gameObject
- the game object@NotNull public TestGameObject insertArchetype(@NotNull GameObjectContainer<TestGameObject,TestMapArchObject,TestArchetype> gameObject, @NotNull BaseObject<TestGameObject,TestMapArchObject,TestArchetype,?> archetype)
gameObject
- the game objectarchetype
- the archetype to insertpublic static void checkMapContents(@NotNull MapModel<TestGameObject,TestMapArchObject,TestArchetype> mapModel, @NotNull String... lines)
MapModel
's contents.mapModel
- the map modellines
- the expected contentsprivate static void checkContentsString(@NotNull MapSquare<TestGameObject,TestMapArchObject,TestArchetype> mapSquare, @NotNull String... gameObjects)
MapSquare
contains the given game objects.mapSquare
- the map squaregameObjects
- the game objectpublic static void checkContents(@NotNull Iterable<TestGameObject> mapSquare, @NotNull BaseObject<?,?,?,?>... gameObjects)
MapSquare
contains the given game objects.mapSquare
- the map squaregameObjects
- the game objectFeedback: webmaster
© 2003-2010 The Gridarta Developers. All rights reserved.