 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.model.mapcontrol;
22 import java.awt.Point;
24 import java.io.IOException;
31 import org.junit.Assert;
32 import org.junit.Test;
53 Assert.assertTrue(mapFile.
getFile().exists());
82 mapControl.
saveAs(mapFile);
83 Assert.assertTrue(mapFile.
getFile().exists());
An Archetype implementation for testing purposes.
File createMapsDirectory(@NotNull final String... specs)
Creates a maps directory consisting of a set of maps.
A MapModel reflects the data of a map.
void saveAs(@NotNull MapFile mapFile)
Saves the file with the given map file.
Base package of all Gridarta classes.
void endTransaction()
End a transaction.
A GameObject implementation for testing purposes.
void beginTransaction(@NotNull String name)
Starts a new transaction.
Regression tests for DefaultMapControl.
static void deleteTempDir(@NotNull final File dir)
Deletes a temporary directory.
void addGameObjectToMap(@NotNull G gameObject, @NotNull Point pos, @NotNull InsertionMode insertionMode)
Add a gameObject to the map.
boolean isModified()
Return whether the map has been modified from the on-disk state.
PathManager getPathManager()
Returns the PathManager.
Helper class for creating MapControl instances for regression tests.
GameObjects are the objects based on Archetypes found on maps.
void testSaveAs1()
Checks that MapControl#saveAs(MapFile) does update the map's file and that it does reset the map's mo...
void testSave1()
Checks that MapControl#save() does not fail if the path to the map file does not yet exist.
MapFile getMapFile(@NotNull final AbsoluteMapPath mapPath)
Returns a MapFile instance from an AbsoluteMapPath.
File getFile()
Returns a File for this map file.
void save()
Saves the map to a file.
The location of a map file with a map directory.
TestGameObject newGameObject(@NotNull final String archetypeName, @NotNull final String objectName)
Creates a new game object.
InsertionMode getTopmostInsertionMode()
Returns the "topmost" insertion mode.
ProjectSettings getProjectSettings()
Returns the ProjectSettings.
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.
File getMapsDirectory()
Returns the default maps directory.
MapFile getMapFile()
Returns the map file.
The class Size2D represents a 2d rectangular area.