 |
Gridarta Editor
|
Go to the documentation of this file.
20 package net.sf.gridarta.model.mapmodel;
22 import java.awt.Point;
23 import java.awt.image.BufferedImage;
24 import javax.swing.ImageIcon;
56 import org.jetbrains.annotations.NotNull;
57 import org.junit.Assert;
75 private static final String @NotNull []
ICON_NAMES = {
ResourceIcons.
SQUARE_SELECTED_SQUARE,
ResourceIcons.
SQUARE_SELECTED_SQUARE_NORTH,
ResourceIcons.
SQUARE_SELECTED_SQUARE_EAST,
ResourceIcons.
SQUARE_SELECTED_SQUARE_SOUTH,
ResourceIcons.
SQUARE_SELECTED_SQUARE_WEST,
ResourceIcons.
SQUARE_PRE_SELECTED_SQUARE,
ResourceIcons.
SQUARE_CURSOR,
ResourceIcons.
SQUARE_EMPTY,
ResourceIcons.
SQUARE_UNKNOWN,
ResourceIcons.
SQUARE_NO_FACE,
ResourceIcons.
SQUARE_NO_ARCH,
ResourceIcons.
DEFAULT_ICON,
ResourceIcons.
DEFAULT_PREVIEW,
ResourceIcons.
SQUARE_WARNING, };
145 final ImageIcon imageIcon =
new ImageIcon(
new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB));
211 mapModel.addGameObjectToMap(gameObject,
new Point(x, y), insertionMode);
222 gameObject.addLast(inv);
272 Assert.fail(ex.getMessage());
273 throw new AssertionError(ex);
An Archetype implementation for testing purposes.
InsertionModeSet< TestGameObject, TestMapArchObject, TestArchetype > getInsertionModeSet()
Returns the InsertionModeSet instance.
This interface represents a lazy loader that provides images on demand.
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.
final AutojoinLists< TestGameObject, TestMapArchObject, TestArchetype > autojoinLists
The AutojoinLists instance.
An Archetype implementation for testing purposes.
static final String SQUARE_PRE_SELECTED_SQUARE
final GameObjectMatchers gameObjectMatchers
The GameObjectMatchers instance.
Abstract factory for creating GameObject instances.
Implementation of MapModel that covers the similarities between crossfire and daimonin.
TestMapModelHelper newTestMapModelHelper()
Creates a new TestMapModelHelper instance.
The view of the archetype chooser.
Base package of all Gridarta classes.
static final String SQUARE_SELECTED_SQUARE_EAST
Helper class for creating MapModel instances for regression tests.
Exception thrown if an Archetype does not exist.
AnimationObjects is a container for AnimationObjects.
MapViewSettings getMapViewSettings()
Returns the MapViewSettings instance.
A GameObject implementation for testing purposes.
static final String SQUARE_NO_FACE
void insertGameObject(@NotNull final GameObject< TestGameObject, TestMapArchObject, TestArchetype > gameObject, @NotNull final String archetypeName, @NotNull final String name)
Inserts a game object into the inventory of another game object.
Helper class for regression tests to create MapModel instances.
static final String SQUARE_EMPTY
Provider for faces of GameObjects and Archetypes.
Reflects a game object (object on a map).
Container for settings that affect the rendering of maps.
static final String SQUARE_SELECTED_SQUARE_WEST
String NAME
The attribute name of the object's name.
An AnimationObjects for regression tests.
void setNormal(@NotNull final FaceProvider normalFaceProvider)
Sets the normal FaceProvider.
A GameObjectParser for regression tests.
AutojoinLists< TestGameObject, TestMapArchObject, TestArchetype > getAutojoinLists()
Returns the AutojoinLists instance.
void setMapSize(@NotNull final Size2D mapSize)
GameObjects are the objects based on Archetypes found on maps.
static final String SQUARE_SELECTED_SQUARE_SOUTH
MapModel< TestGameObject, TestMapArchObject, TestArchetype > newMapModel(final int w, final int h)
Creates a new MapModel instance.
An GameObjectMatcher matching certain archetype types.
FaceObjectProviders getFaceObjectProviders()
Returns the FaceObjectProviders instance.
static final String DEFAULT_ICON
The default map icon to use if no icon can be created.
GameObjectFactory< TestGameObject, TestMapArchObject, TestArchetype > getGameObjectFactory()
Returns the GameObjectFactory instance.
A GameObjectFactory for regression tests.
Classes related to matching {GameObjects}, so called { net.sf.gridarta.model.match....
final InsertionMode topmostInsertionMode
The "topmost" InsertionMode instance.
final MapViewSettings mapViewSettings
The MapViewSettings instance.
A factory for creating Archetype instances.
A FaceProvider that does not return any faces.
ArchetypeSet< TestGameObject, TestMapArchObject, TestArchetype > getArchetypeSet()
Returns the ArchetypeSet.
Maintains GameObjectMatcher instances.
A MapViewSettings implementation for regression tests.
FaceObjects is a container for FaceObjects.
Interface that captures similarities between different ArchetypeSet implementations.
static final String SQUARE_WARNING
GameObjectMatchers getGameObjectMatchers()
Returns the GameObjectMatchers instance.
Manages a mapping between archetypes to AutojoinLists.
An ArchetypeFactory implementation for testing purposes.
static final String SQUARE_CURSOR
Reading and writing of maps, handling of paths.
final AnimationObjects animationObjects
The AnimationObjects instance.
ArchetypeChooserModel< TestGameObject, TestMapArchObject, TestArchetype > getArchetypeChooserModel()
Returns the ArchetypeChooserModel instance.
TestGameObject newGameObject(@NotNull final String archetypeName, @NotNull final String objectName, final int type)
Creates a new game object.
TestArchetype getArchetype(@NotNull final String archetypeName)
Returns an archetype.
TestGameObject newGameObject(@NotNull final String archetypeName, @NotNull final String objectName)
Creates a new game object.
static final String SQUARE_UNKNOWN
InsertionMode getTopmostInsertionMode()
Returns the "topmost" insertion mode.
static final String DEFAULT_PREVIEW
The default map preview to use if no icon can be created.
TestMapModelCreator(final boolean createIcons)
Creates a new instance.
void addToCache(@NotNull final String name, @NotNull final ImageIcon imageIcon)
Add an image to the cache.
static final String SQUARE_SELECTED_SQUARE_NORTH
void addGameObjectToMap(@NotNull final MapModel< TestGameObject, TestMapArchObject, TestArchetype > mapModel, @NotNull final String archetypeName, @NotNull final String name, final int x, final int y, @NotNull final InsertionMode insertionMode)
Inserts a game object into a map.
The face is the appearance of an object.
final ResourceIcons resourceIcons
The ResourceIcons instance.
Gridarta can handle frame information of animations and allow the selection of an animation using a t...
final InsertionModeSet< TestGameObject, TestMapArchObject, TestArchetype > insertionModeSet
The InsertionModeSet instance.
An Exception indicating that an Archetype name is not unique.
final ArchetypeChooserModel< TestGameObject, TestMapArchObject, TestArchetype > archetypeChooserModel
The ArchetypeChooserModel instance.
TestArchetype getArchetype(@NotNull final String archetypeName, final int type)
Returns an archetype.
final ArchetypeSet< TestGameObject, TestMapArchObject, TestArchetype > archetypeSet
The ArchetypeSet instance.
A MapArchObject implementation for testing purposes.
Creates ImageIcon instances from resources.
String TYPE
The attribute name of the object's type.
Interface for classes that read or write GameObject instances.
Base implementation of ArchetypeSet.
The class Size2D represents a 2d rectangular area.
final GameObjectFactory< TestGameObject, TestMapArchObject, TestArchetype > gameObjectFactory
The GameObjectFactory instance.
ResourceIcons getResourceIcons()
Returns the ResourceIcons instance.
A FaceObjects for regression tests.
static final String SQUARE_NO_ARCH
GameObjectParser< TestGameObject, TestMapArchObject, TestArchetype > newGameObjectParser()
Creates a new GameObjectParser instance.
final FaceObjectProviders faceObjectProviders
The FaceObjectProviders instance.
static final String[] ICON_NAMES
Predefined icon names.
static final String SQUARE_SELECTED_SQUARE