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 if (faceName.equals(
"face")) {
101 return new ImageIcon();
107 public void reload() {
114 final Point point =
new Point(0, 0);
118 Assert.assertNotNull(env);
122 Assert.assertNotNull(inv);
G createGameObject(@NotNull R archetype)
Creates a new GameObject from an Archetype.
void addLast(@NotNull G gameObject)
Adds the given GameObject at the end of this Container.
MapModel< TestGameObject, TestMapArchObject, TestArchetype > newMapModel(final int w, final int h)
Creates a new MapModel instance.
A MapModel reflects the data of a map.
ArchetypeSet< TestGameObject, TestMapArchObject, TestArchetype > getArchetypeSet()
Returns the ArchetypeSet.
Helper class for regression tests to create MapModel instances.
Enumeration describing the state of the face.
Helper class for creating MapModel instances for regression tests.
String FACE
The attribute name of the object's face.
This interface represents a lazy loader that provides images on demand.
FaceObjectProviders getFaceObjectProviders()
Returns the FaceObjectProviders instance.
A MapArchObject implementation for testing purposes.
TestGameObject insertFloor(@NotNull final MapModel< TestGameObject, TestMapArchObject, TestArchetype > mapModel, @NotNull final Point point)
Inserts a floorArchetype game object into a map model.
Base package of all Gridarta classes.
ARCHETYPE_FACE
This GameObject has no face defined and thus inherited the face from its archetype.
Abstract factory for creating GameObject instances.
void testDoMoveSquareTopSingle()
Checks that net.sf.gridarta.model.gameobject.GameObjectFactory#cloneGameObject(GameObject) correctly ...
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.
An Exception indicating that an Archetype name is not unique.
void testUpdateFaceInformation()
Checks that face information is updated for inventory objects cloned from an archetype.
void setNormal(@NotNull final FaceProvider normalFaceProvider)
Sets the normal FaceProvider.
R newArchetype(@NotNull String archetypeName)
Creates a new Archetype instance.
void addArchetype(@NotNull R archetype)
Adds an Archetype to this Set.
Regression tests for GameObjectFactory.
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.
The face is the appearance of an object.
An Archetype implementation for testing purposes.
A GameObject implementation for testing purposes.
Interface that captures similarities between different ArchetypeSet implementations.
void beginTransaction(@NotNull String name)
Starts a new transaction.
GameObjectFactory< TestGameObject, TestMapArchObject, TestArchetype > getGameObjectFactory()
Returns the GameObjectFactory instance.