10 #include "../gamemap.h"
11 #include "../loaders.h"
15 #include "../actions/spawnobject.h"
16 #include "../actions/putobjectcommand.h"
22 auto_ptr<GameMap> game (
startMap(
"unittest-objectconstruction.map"));
31 MapField* fld = game->getField( pos );
52 auto_ptr<GameMap> game (
startMap(
"unittest-objectremoval.map"));
58 MapField* fld = game->getField( pos );
64 Vehicle* v = game->getField( unit )->vehicle;
ItemRepositoryLoader< ObjectType > objectTypeRepository("objecttype")
int id
the id of the object, used when referencing objects in files
map accessing and usage routines used by ASC and the mapeditor
#define assertOrThrow(expr)
Context createTestingContext(GameMap *gamemap)
a single field of the map
ActionResult undo(const Context &context)
void setTarget(const MapCoordinate &target, int objectID)
ActionResult execute(const Context &context)
An object that can be placed on fields. Roads, pipelines and ditches are examples of objects...
Coordinate on the twodimensional map.
GameMap * startMap(const ASCString &filename)
VisibilityStates fieldVisibility(const MapField *pe)
}@
void testObjectConstruction1()
Object * checkForObject(const ObjectType *o)
checks if there are objects from the given type on the field and returns them
void testObjectConstruction()
ActionResult searchFields()