 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.model.floodfill;
22 import java.awt.Point;
23 import java.util.ArrayList;
24 import java.util.Collection;
25 import java.util.List;
35 import org.junit.Assert;
36 import org.junit.Test;
60 head.addTailPart(tail1);
63 head.addTailPart(tail2);
67 head.addTailPart(tail3);
72 final Collection<MapSquare<TestGameObject, TestMapArchObject, TestArchetype>> selection =
new ArrayList<>();
74 final List<TestGameObject> gameObjects =
new ArrayList<>();
78 Assert.assertTrue(mapModel.
getMapSquare(
new Point(2, 0)).isEmpty());
81 Assert.assertFalse(mapModel.
getMapSquare(
new Point(2, 0)).isEmpty());
An Archetype implementation for testing purposes.
InsertionModeSet< TestGameObject, TestMapArchObject, TestArchetype > getInsertionModeSet()
Returns the InsertionModeSet instance.
A MapModel reflects the data of a map.
TestMapModelHelper newTestMapModelHelper()
Creates a new TestMapModelHelper instance.
Base package of all Gridarta classes.
Helper class for creating MapModel instances for regression tests.
A GameObject implementation for testing purposes.
void beginTransaction(@NotNull String name)
Starts a new transaction.
Helper class for regression tests to create MapModel instances.
void testFillAdjacent()
Checks that Collection, net.sf.gridarta.model.mapmodel.InsertionMode, List, int, boolean) works corre...
void setMultiY(int multiY)
Sets the y-position of this part of a multi-part object.
Regression tests for FillUtils.
GameObjects are the objects based on Archetypes found on maps.
MapModel< TestGameObject, TestMapArchObject, TestArchetype > newMapModel(final int w, final int h)
Creates a new MapModel instance.
GameObjectFactory< TestGameObject, TestMapArchObject, TestArchetype > getGameObjectFactory()
Returns the GameObjectFactory 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.
MapSquare< G, A, R > getMapSquare(@NotNull Point pos)
Get the square at a specified location.
Utility class implementing fill operations on map instances.
An Exception indicating that an Archetype name is not unique.
A MapArchObject implementation for testing purposes.
String TYPE
The attribute name of the object's type.
static< G extends GameObject< G, A, R > A extends R extends Archetype< G, A, R > void fill(@NotNull final MapModel< G, A, R > mapModel, @NotNull final Collection< MapSquare< G, A, R >> selection, @NotNull final InsertionMode insertionMode, @NotNull final List<? extends BaseObject< G, A, R, ?>> gameObjects, final int density, final boolean noAdjacent)
void setMultiX(int multiX)
Sets the x-position of this part of a multi-part object.