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

#include <spawnunit.h>

Inheritance diagram for SpawnUnit:
Inheritance graph
[legend]

Public Member Functions

 SpawnUnit (GameMap *gamemap, const MapCoordinate3D &position, int vehicleTypeID, int owner)
 
 SpawnUnit (GameMap *gamemap, const ContainerBase *carrier, int vehicleTypeID)
 
ASCString getDescription () const
 
VehiclegetUnit ()
 
- 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
 
- 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...
 
virtual bool undoOrderChildFirst () const
 determines the order in which the child actions are undone. More...
 
GameMapgetMap ()
 
const GameMapgetMap () const
 

Friends

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 spawnunit.h.

Constructor & Destructor Documentation

SpawnUnit::SpawnUnit ( GameMap gamemap,
const MapCoordinate3D position,
int  vehicleTypeID,
int  owner 
)

Definition at line 31 of file spawnunit.cpp.

SpawnUnit::SpawnUnit ( GameMap gamemap,
const ContainerBase carrier,
int  vehicleTypeID 
)

Definition at line 39 of file spawnunit.cpp.

References ContainerBase::getOwner().

Member Function Documentation

ASCString SpawnUnit::getDescription ( ) const
virtual
GameActionID SpawnUnit::getID ( ) const
protectedvirtual

Implements GameAction.

Definition at line 106 of file spawnunit.cpp.

References ActionRegistry::SpawnUnit.

Vehicle * SpawnUnit::getUnit ( )

Definition at line 154 of file spawnunit.cpp.

References GameAction::getMap(), and GameMap::getUnit().

Referenced by ConstructUnitCommand::go(), and undoAction().

void SpawnUnit::readData ( tnstream stream)
protectedvirtual

Implements GameAction.

Definition at line 72 of file spawnunit.cpp.

References MapCoordinate3D::read(), and tnstream::readInt().

ActionResult SpawnUnit::runAction ( const Context context)
protectedvirtual
ActionResult SpawnUnit::undoAction ( const Context context)
protectedvirtual
ActionResult SpawnUnit::verify ( )
protectedvirtual

Definition at line 186 of file spawnunit.cpp.

References GameAction::getMap().

void SpawnUnit::writeData ( tnstream stream) const
protectedvirtual

Implements GameAction.

Definition at line 92 of file spawnunit.cpp.

References MapCoordinate3D::write(), and tnstream::writeInt().

Friends And Related Function Documentation

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

Definition at line 114 of file action.h.


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