 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.actions;
22 import java.awt.GraphicsEnvironment;
23 import java.awt.Point;
39 import org.jetbrains.annotations.NotNull;
40 import org.junit.Assert;
41 import org.junit.Test;
56 if (GraphicsEnvironment.isHeadless()) {
63 for (
int i = 0; i < 16; i++) {
67 autojoinListsHelper.
newAutojoinLists(
"a0",
"a1",
"a2",
"a3",
"a4",
"a5",
"a6",
"a7",
"a8",
"a9",
"a10",
"a11",
"a12",
"a13",
"a14",
"a15");
116 Assert.assertNotNull(
object);
117 Assert.assertEquals(face,
object.getAttributeString(
BaseObject.
FACE));
An Archetype implementation for testing purposes.
MapManager< TestGameObject, TestMapArchObject, TestArchetype > getMapManager()
Returns the MapManager.
A MapModel reflects the data of a map.
static void checkFace(@NotNull final MapModel< TestGameObject, TestMapArchObject, TestArchetype > mapModel, final int x, final int y, @NotNull final String face)
Checks the face name of the first object in a map square.
void undo()
"Undo" was selected.
TestMapModelHelper newTestMapModelHelper()
Creates a new TestMapModelHelper instance.
Base package of all Gridarta classes.
Helper class for creating MapModel instances for regression tests.
G getFirst(@NotNull final GameObjectMatcher gameObjectMatcher)
Returns the first occurrence of a matching game object.
void endTransaction()
End a transaction.
void newAutojoinLists(@NotNull final String... archetypeNames)
Creates a new AutojoinLists instance.
MapViewSettings getMapViewSettings()
Returns the MapViewSettings instance.
A GameObject implementation for testing purposes.
void beginTransaction(@NotNull String name)
Starts a new transaction.
Helper class for regression tests to create MapModel instances.
Implements the controller for undo/redo actions.
Implements AutojoinList related functions.
Graphical User Interface of Gridarta.
void setMapSize(@NotNull final Size2D mapSize)
void setAutojoin(boolean autojoin)
Sets the "autojoin" state.
Helper class for creating MapControl instances for regression tests.
GameObjects are the objects based on Archetypes found on maps.
GameObjectFactory< TestGameObject, TestMapArchObject, TestArchetype > getGameObjectFactory()
Returns the GameObjectFactory instance.
String FACE
The attribute name of the object's face.
Exception thrown if an AutojoinList is invalid.
GameObjectMatchers getGameObjectMatchers()
Returns the GameObjectMatchers instance.
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.
TestArchetype getArchetype(@NotNull final String archetypeName)
Returns an archetype.
Regression tests for UndoActions.
static void checkMapContents(@NotNull final MapModel< TestGameObject, TestMapArchObject, TestArchetype > mapModel, @NotNull final String... lines)
Checks for expected MapModel's contents.
void testInsert1()
Checks that undo correctly sets the "face" attribute.
An Exception indicating that an Archetype name is not unique.
Currently nothing more than a marker interface for unification.
TestMapModelCreator getMapModelCreator()
Returns the TestMapModelCreator instance.
MapModel< G, A, R > getMapModel()
Returns the map model.
A MapArchObject implementation for testing purposes.
The class Size2D represents a 2d rectangular area.
MapSquare< G, A, R > getMapSquare()
Returns the MapSquare this game object is part of.
AutojoinListsHelper newAutojoinListsHelper()
Returns a new AutojoinListsHelper instance.
UI parts of the implementation of an Undo / Redo in Gridarta.