Advanced Strategic Command
Public Member Functions | Protected Member Functions | Friends | List of all members
SpawnObject Class Reference

#include <spawnobject.h>

Inheritance diagram for SpawnObject:
Inheritance graph

Public Member Functions

 SpawnObject (GameMap *gamemap, const MapCoordinate &position, int objectID, int direction=-1)
ASCString getDescription () const
- Public Member Functions inherited from GameAction
ActionResult execute (const Context &context)
ActionResult undo (const Context &context)
void read (tnstream &stream)
void write (tnstream &stream) const
void write (tnstream &stream, bool persistChildren) const
virtual ~GameAction ()

Protected Member Functions

virtual GameActionID getID () const
virtual ActionResult runAction (const Context &context)
virtual ActionResult undoAction (const Context &context)
virtual ActionResult verify ()
virtual void readData (tnstream &stream)
virtual void writeData (tnstream &stream) const
virtual bool undoOrderChildFirst () const
 determines the order in which the child actions are undone. More...
- Protected Member Functions inherited from GameAction
void deleteChildren ()
 GameAction (GameMap *map)
void addChild (GameAction *action)
 adds a child action. Ownership of the child action is passed to THIS More...
virtual ActionResult preCheck ()
 preCheck is called before an action is redone and should check the preconditions for the action. More...
virtual ActionResult postCheck ()
 postCheck is called after an action has been redone and should check that the state of the map is exactly the same as it was after the action has been executed the first time. More...
GameMapgetMap ()
const GameMapgetMap () const


template<class Child >
GameActionGameActionCreator (GameMap *map)

Additional Inherited Members

- Static Public Member Functions inherited from GameAction
static GameActionreadFromStream (tnstream &stream, GameMap *map)

Detailed Description

Definition at line 30 of file spawnobject.h.

Constructor & Destructor Documentation

SpawnObject::SpawnObject ( GameMap gamemap,
const MapCoordinate position,
int  objectID,
int  direction = -1 

Definition at line 28 of file spawnobject.cpp.

Member Function Documentation

ASCString SpawnObject::getDescription ( ) const
GameActionID SpawnObject::getID ( ) const

Implements GameAction.

Definition at line 93 of file spawnobject.cpp.

References ActionRegistry::SpawnObject.

void SpawnObject::readData ( tnstream stream)

Implements GameAction.

Definition at line 55 of file spawnobject.cpp.

References MapCoordinate::read(), tnstream::readInt(), and spawnObjectStreamVersion.

ActionResult SpawnObject::runAction ( const Context context)
ActionResult SpawnObject::undoAction ( const Context context)
virtual bool SpawnObject::undoOrderChildFirst ( ) const

determines the order in which the child actions are undone.

If true, then the children are undone first and then this action will be undone. If false, then this action will be undone first and the children after that

Reimplemented from GameAction.

Definition at line 58 of file spawnobject.h.

ActionResult SpawnObject::verify ( )

Definition at line 177 of file spawnobject.cpp.

void SpawnObject::writeData ( tnstream stream) const

Implements GameAction.

Definition at line 80 of file spawnobject.cpp.

References spawnObjectStreamVersion, MapCoordinate::write(), and tnstream::writeInt().

Friends And Related Function Documentation

template<class Child >
GameAction* GameActionCreator ( GameMap map)

Definition at line 114 of file action.h.

The documentation for this class was generated from the following files: