 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.gui.dialog.replace;
22 import java.awt.Point;
23 import java.util.Collections;
24 import java.util.List;
38 import org.junit.Assert;
39 import org.junit.Test;
44 @SuppressWarnings(
"JavaDoc")
60 map.
insertBaseObject(gameObject1,
new Point(0, 0),
true,
false, insertionMode);
64 map.
insertBaseObject(gameObject2,
new Point(1, 0),
true,
false, insertionMode);
70 final List<? extends BaseObject<TestGameObject, TestMapArchObject, TestArchetype, ?>> replaceList = Collections.singletonList(arch2);
75 Assert.assertNotNull(gameObject1);
76 Assert.assertEquals(arch2, gameObject1.getArchetype());
80 Assert.assertNotNull(gameObject2);
81 Assert.assertEquals(arch2, gameObject2.getArchetype());
An Archetype implementation for testing purposes.
static< G extends GameObject< G, A, R > A extends R extends Archetype< G, A, R > int replace(@NotNull final MatchCriteria< G, A, R > matchCriteria, final boolean entireMap, final boolean deleteOnly, final int replaceDensity, @NotNull final MapView< G, A, R > mapView, @NotNull final InsertionModeSet< G, A, R > insertionModeSet, @Nullable final List<? extends BaseObject< G, A, R, ?>> replaceList)
A MapModel reflects the data of a map.
String getArchetypeName()
Returns the name of this archetype.
G insertBaseObject(@NotNull BaseObject< G, A, R, ?> baseObject, @NotNull Point pos, boolean allowMany, boolean join, @NotNull InsertionMode insertionMode)
Inserts a BaseObject to a map.
Base package of all Gridarta classes.
G getFirst(@NotNull final GameObjectMatcher gameObjectMatcher)
Returns the first occurrence of a matching game object.
void replace_withElevation_retainsElevation()
void endTransaction()
End a transaction.
InsertionModeSet< TestGameObject, TestMapArchObject, TestArchetype > getInsertionModeSet()
Returns the InsertionModeSet.
A GameObject implementation for testing purposes.
void beginTransaction(@NotNull String name)
Starts a new transaction.
A MatchCriteria that matches by archetype name.
static MapView< TestGameObject, TestMapArchObject, TestArchetype > newMapView(@NotNull final MapControl< TestGameObject, TestMapArchObject, TestArchetype > mapControl)
Creates a new MapView instance.
Regression tests for ShrinkMapSizeUtils.
Graphical User Interface of Gridarta.
Helper class for creating MapControl instances for regression tests.
GameObjects are the objects based on Archetypes found on maps.
A map view consists of a map grid and a map cursor, and is attached to a map control.
TestArchetype getArchetype(@NotNull final String archetypeName)
Returns an archetype.
Helper class for creating MapControl instances for regression tests.
TestGameObject newGameObject(@NotNull final String archetypeName, @NotNull final String objectName)
Creates a new game object.
MapSquare< G, A, R > getMapSquare(@NotNull Point pos)
Get the square at a specified location.
static final String ELEVATION
The name of the "elevation" attribute.
Base classes for rendering maps.
Utility class to replace objects in a map.
MapControl< TestGameObject, TestMapArchObject, TestArchetype > newMapControl(@Nullable final MapFile mapFile, @NotNull final String mapName, @NotNull final Size2D mapSize)
Creates a new map control.
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.
Utility class to remove empty squares from a map's border.