 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.model.gameobject;
22 import java.awt.Point;
23 import javax.swing.ImageIcon;
33 import org.jetbrains.annotations.NotNull;
34 import org.jetbrains.annotations.Nullable;
35 import org.junit.Assert;
36 import org.junit.Test;
55 final Point point =
new Point(0, 0);
62 Assert.assertNotSame(ob1, ob1Clone);
63 Assert.assertEquals(1, ob1Clone.countInvObjects());
65 Assert.assertNotNull(ob2Clone);
66 Assert.assertNotSame(ob2, ob2Clone);
68 Assert.assertSame(ob1, ob2.getContainer());
69 Assert.assertSame(ob1Clone, ob2Clone.getContainer());
99 public ImageIcon getImageIconForFacename(@NotNull
final String faceName,
final long stretch) {
100 return faceName.equals(
"face") ?
new ImageIcon() :
null;
104 public void reload() {
111 final Point point =
new Point(0, 0);
115 Assert.assertNotNull(env);
119 Assert.assertNotNull(inv);
An Archetype implementation for testing purposes.
This interface represents a lazy loader that provides images on demand.
A MapModel reflects the data of a map.
Abstract factory for creating GameObject instances.
TestGameObject insertExit(@NotNull final MapModel< TestGameObject, TestMapArchObject, TestArchetype > mapModel, @NotNull final Point point)
Inserts an exitArchetype game object into a map model.
TestMapModelHelper newTestMapModelHelper()
Creates a new TestMapModelHelper instance.
Enumeration describing the state of the face.
Base package of all Gridarta classes.
Helper class for creating MapModel instances for regression tests.
A GameObject implementation for testing purposes.
void testUpdateFaceInformation()
Checks that face information is updated for inventory objects cloned from an archetype.
void beginTransaction(@NotNull String name)
Starts a new transaction.
Helper class for regression tests to create MapModel instances.
void setNormal(@NotNull final FaceProvider normalFaceProvider)
Sets the normal FaceProvider.
void addArchetype(@NotNull R archetype)
Adds an Archetype to this Set.
MapModel< TestGameObject, TestMapArchObject, TestArchetype > newMapModel(final int w, final int h)
Creates a new MapModel instance.
FaceObjectProviders getFaceObjectProviders()
Returns the FaceObjectProviders instance.
R newArchetype(@NotNull String archetypeName)
Creates a new Archetype instance.
GameObjectFactory< TestGameObject, TestMapArchObject, TestArchetype > getGameObjectFactory()
Returns the GameObjectFactory instance.
String FACE
The attribute name of the object's face.
ArchetypeSet< TestGameObject, TestMapArchObject, TestArchetype > getArchetypeSet()
Returns the ArchetypeSet.
Regression tests for GameObjectFactory.
TestGameObject insertFloor(@NotNull final MapModel< TestGameObject, TestMapArchObject, TestArchetype > mapModel, @NotNull final Point point)
Inserts a floorArchetype game object into a map model.
G createGameObject(@NotNull R archetype)
Creates a new GameObject from an Archetype.
Interface that captures similarities between different ArchetypeSet implementations.
TestGameObject insertArchetype(@NotNull final MapModel< TestGameObject, TestMapArchObject, TestArchetype > mapModel, final int x, final int y, @NotNull final BaseObject< TestGameObject, TestMapArchObject, TestArchetype, ?> archetype, final boolean join)
Inserts an archetype game object into a map model.
void testDoMoveSquareTopSingle()
Checks that GameObjectFactory#cloneGameObject(GameObject) correctly updates the container.
The face is the appearance of an object.
An Exception indicating that an Archetype name is not unique.
A MapArchObject implementation for testing purposes.
ARCHETYPE_FACE
This GameObject has no face defined and thus inherited the face from its archetype.
void addLast(@NotNull G gameObject)
Adds the given GameObject at the end of this Container.