net.sf.gridarta.model.mapmodel
public class DefaultMapModelTest extends Object
DefaultMapModel
.Modifier and Type | Field and Description |
---|---|
private MapArchObjectListener |
mapArchObjectListener
The
MapArchObjectListener registered to all map models to record
map changes. |
private MapModelListener<TestGameObject,TestMapArchObject,TestArchetype> |
mapModelListener
The map model listener registered to all map models to record map
changes.
|
private StringBuilder |
result
Collects the map model changes.
|
Constructor and Description |
---|
DefaultMapModelTest() |
Modifier and Type | Method and Description |
---|---|
private void |
log(String name,
Iterable<MapSquare<TestGameObject,TestMapArchObject,TestArchetype>> mapSquares,
Iterable<TestGameObject> gameObjects)
Records a change event.
|
private MapModel<TestGameObject,TestMapArchObject,TestArchetype> |
newMapModel(TestMapModelCreator mapModelCreator)
Creates a new
MapModel instance. |
void |
testAddGameObjectToMap1()
|
void |
testAddGameObjectToMap2()
|
void |
testEditType1()
Checks that modifications correctly update edit types.
|
void |
testEmpty()
Test case for an empty transaction.
|
void |
testGetAllGameObjects1()
Test case for
DefaultMapModel.getAllGameObjects() : for a 1x2 game
object only the head should be returned. |
void |
testModifiedGameObject1()
Test case for changed objects.
|
void |
testModifiedGameObject2()
Test case for changed objects.
|
void |
testResizeMap1()
Test case for
MapArchObject.setMapSize(Size2D) . |
void |
testResizeMap2()
Test case for
MapArchObject.setMapSize(Size2D) . |
void |
testResizeMap3()
Test case for
MapArchObject.setMapSize(Size2D) . |
void |
testResizeMap4()
Test case for
MapArchObject.setMapSize(Size2D) . |
void |
testUpdateDirectionOnInsert()
Test case for
DefaultMapModel.getAllGameObjects() : the BaseObject.DIRECTION attribute is set only if the inserted object
supports a direction. |
@NotNull private final MapModelListener<TestGameObject,TestMapArchObject,TestArchetype> mapModelListener
@NotNull private final MapArchObjectListener mapArchObjectListener
MapArchObjectListener
registered to all map models to record
map changes.@NotNull private final StringBuilder result
public DefaultMapModelTest()
public void testEmpty()
public void testResizeMap1()
MapArchObject.setMapSize(Size2D)
.public void testResizeMap2()
MapArchObject.setMapSize(Size2D)
.public void testResizeMap3()
MapArchObject.setMapSize(Size2D)
.public void testResizeMap4()
MapArchObject.setMapSize(Size2D)
.public void testAddGameObjectToMap1()
public void testAddGameObjectToMap2()
public void testModifiedGameObject1()
public void testModifiedGameObject2()
public void testGetAllGameObjects1()
DefaultMapModel.getAllGameObjects()
: for a 1x2 game
object only the head should be returned.public void testUpdateDirectionOnInsert()
DefaultMapModel.getAllGameObjects()
: the BaseObject.DIRECTION
attribute is set only if the inserted object
supports a direction.public void testEditType1()
private void log(@NotNull String name, @Nullable Iterable<MapSquare<TestGameObject,TestMapArchObject,TestArchetype>> mapSquares, @Nullable Iterable<TestGameObject> gameObjects)
name
- the event namemapSquares
- the changed map squaresgameObjects
- the changed game objects@NotNull private MapModel<TestGameObject,TestMapArchObject,TestArchetype> newMapModel(@NotNull TestMapModelCreator mapModelCreator)
MapModel
instance.mapModelCreator
- the map model creator to useFeedback: webmaster
© 2003-2010 The Gridarta Developers. All rights reserved.