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

#include <unitcommand.h>

Inheritance diagram for UnitCommand:
Inheritance graph
[legend]

Public Member Functions

virtual vector< MapCoordinategetCoordinates () const
 this is for informational purposes, so the player can see where a Command has taken place when reviewing it More...
 
int getUnitTypeID () const
 
- Public Member Functions inherited from Command
State getState () const
 
virtual ASCString getCommandString () const =0
 
ActionResult redo (const Context &context)
 
- 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 ASCString getDescription () const =0
 
virtual ~GameAction ()
 

Protected Member Functions

const VehiclegetUnit () const
 
VehiclegetUnit ()
 
int getUnitID () const
 
 UnitCommand (GameMap *map)
 
 UnitCommand (Vehicle *vehicle)
 
void readData (tnstream &stream)
 
void writeData (tnstream &stream) const
 
ActionResult checkExecutionPrecondition () const
 
- Protected Member Functions inherited from Command
 Command (GameMap *gamemap)
 
void setState (State state)
 
virtual ActionResult go (const Context &context)=0
 
virtual ActionResult runAction (const Context &context)
 
virtual ActionResult undoAction (const Context &context)
 
- 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...
 
virtual GameActionID getID () const =0
 
GameMapgetMap ()
 
const GameMapgetMap () const
 

Additional Inherited Members

- Public Types inherited from Command
enum  State {
  Planned, Evaluated, SetUp, Run,
  Finished, Failed
}
 
- Static Public Member Functions inherited from GameAction
static GameActionreadFromStream (tnstream &stream, GameMap *map)
 

Detailed Description

Definition at line 29 of file unitcommand.h.

Constructor & Destructor Documentation

UnitCommand::UnitCommand ( GameMap map)
protected

Definition at line 44 of file unitcommand.cpp.

UnitCommand::UnitCommand ( Vehicle vehicle)
protected

Definition at line 36 of file unitcommand.cpp.

Member Function Documentation

ActionResult UnitCommand::checkExecutionPrecondition ( ) const
protectedvirtual

Reimplemented from Command.

Definition at line 95 of file unitcommand.cpp.

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

vector< MapCoordinate > UnitCommand::getCoordinates ( ) const
virtual

this is for informational purposes, so the player can see where a Command has taken place when reviewing it

Reimplemented from Command.

Reimplemented in MoveUnitCommand.

Definition at line 76 of file unitcommand.cpp.

References Command::getCoordinates(), and MapCoordinate::valid().

const Vehicle * UnitCommand::getUnit ( ) const
protected
Vehicle * UnitCommand::getUnit ( )
protected

Definition at line 31 of file unitcommand.cpp.

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

int UnitCommand::getUnitID ( ) const
inlineprotected
int UnitCommand::getUnitTypeID ( ) const
void UnitCommand::readData ( tnstream stream)
protectedvirtual
void UnitCommand::writeData ( tnstream stream) const
protectedvirtual

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