 |
Gridarta Editor
|
Go to the documentation of this file.
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());
An Archetype implementation for testing purposes.
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.
A MapModel reflects the data of a map.
Base package of all Gridarta classes.
A GameObject implementation for testing purposes.
Helper class for regression tests to create MapModel instances.
PathManager getPathManager()
Returns the PathManager.
void testReorderMultiSquares()
Checks that map loading doesn't reorder multi-square game objects.
Helper class for creating MapControl instances for regression tests.
GameObjects are the objects based on Archetypes found on maps.
ArchetypeSet< TestGameObject, TestMapArchObject, TestArchetype > getArchetypeSet()
Returns the ArchetypeSet.
MapFile getMapFile(@NotNull final AbsoluteMapPath mapPath)
Returns a MapFile instance from an AbsoluteMapPath.
DefaultMapReader< TestGameObject, TestMapArchObject, TestArchetype > newMapReader(@NotNull final File mapFile)
Creates a new instance.
void save()
Saves the map to a file.
TestArchetype getArchetype(@NotNull final String archetypeName)
Returns an archetype.
Default implementation of MapReader.
MapControl< TestGameObject, TestMapArchObject, TestArchetype > newMapControl(@Nullable final MapFile mapFile, @NotNull final String mapName, @NotNull final Size2D mapSize)
Creates a new map control.
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.
List< G > getGameObjects()
The class Size2D represents a 2d rectangular area.
Regression tests for DefaultMapReader.
void setMultiX(int multiX)
Sets the x-position of this part of a multi-part object.