20 package net.sf.gridarta.model.io;
22 import java.awt.Point;
24 import java.io.IOException;
25 import java.util.List;
35 import org.junit.Assert;
36 import org.junit.Test;
53 final File mapFile = File.createTempFile(
"gridarta", null);
60 arch2x1.addTailPart(arch2x1b);
70 Assert.assertEquals(6, objects.size());
71 Assert.assertEquals(
"arch1x1", objects.get(0).getArchetype().getArchetypeName());
72 Assert.assertEquals(
"arch2x1", objects.get(1).getArchetype().getArchetypeName());
73 Assert.assertEquals(
"arch1x1", objects.get(2).getArchetype().getArchetypeName());
74 Assert.assertEquals(
"arch1x1", objects.get(3).getArchetype().getArchetypeName());
75 Assert.assertEquals(
"arch1x1", objects.get(4).getArchetype().getArchetypeName());
76 Assert.assertEquals(
"arch2x1b", objects.get(5).getArchetype().getArchetypeName());
void save()
Saves the map to a file.
A MapModel reflects the data of a map.
PathManager getPathManager()
Returns the PathManager.
void testReorderMultiSquares()
Checks that map loading doesn't reorder multi-square game objects.
ArchetypeSet< TestGameObject, TestMapArchObject, TestArchetype > getArchetypeSet()
Returns the ArchetypeSet.
Helper class for regression tests to create MapModel instances.
TestMapModelCreator getMapModelCreator()
Returns the TestMapModelCreator instance.
Helper class for creating MapControl instances for regression tests.
Default implementation of MapReader.
MapFile getMapFile(@NotNull final AbsoluteMapPath mapPath)
Returns a MapFile instance from an AbsoluteMapPath.
Regression tests for DefaultMapReader.
A MapArchObject implementation for testing purposes.
MapModel< G, A, R > getMapModel()
Returns the map model.
Base package of all Gridarta classes.
List< G > getGameObjects()
An Exception indicating that an Archetype name is not unique.
void setMultiX(int multiX)
Sets the x-position of this part of a multi-part object.
GameObjects are the objects based on Archetypes found on maps.
G insertArchToMap(@NotNull BaseObject< G, A, R, ?> templateBaseObject, @Nullable G nextGameObject, @NotNull Point pos, boolean join)
Insert a game object to the map at a specified position.
TestArchetype newArchetype(@NotNull final String archetypeName)
Creates a new TestArchetype instance but doesn't add it to the archetype set.
TestArchetype getArchetype(@NotNull final String archetypeName)
Returns an archetype.
Currently nothing more than a marker interface for unification.
An Archetype implementation for testing purposes.
A GameObject implementation for testing purposes.
DefaultMapReader< TestGameObject, TestMapArchObject, TestArchetype > newMapReader(@NotNull final File mapFile)
Creates a new instance.
The class Size2D represents a 2d rectangular area.
MapControl< TestGameObject, TestMapArchObject, TestArchetype > newMapControl(@Nullable final MapFile mapFile, @NotNull final String mapName, @NotNull final Size2D mapSize)
Creates a new map control.