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

#include <repairunitcommand.h>

Inheritance diagram for RepairUnitCommand:
Inheritance graph
[legend]

Public Member Functions

 RepairUnitCommand (ContainerBase *servicer)
 
ActionResult go (const Context &context)
 
ASCString getCommandString () const
 
vector< Vehicle * > getExternalTargets ()
 
vector< Vehicle * > getInternalTargets ()
 
bool validTarget (const Vehicle *target)
 
void setTarget (Vehicle *target)
 
const ContainerBasegetRepairingUnit () const
 
ActionResult checkExecutionPrecondition () const
 
- Public Member Functions inherited from Command
State getState () const
 
ActionResult redo (const Context &context)
 
virtual vector< MapCoordinategetCoordinates () const
 this is for informational purposes, so the player can see where a Command has taken place when reviewing it More...
 
- 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 ()
 

Static Public Member Functions

static bool avail (const ContainerBase *servicer)
 
static bool availInternally (const ContainerBase *servicer)
 
static bool availExternally (const Vehicle *servicer)
 
- Static Public Member Functions inherited from GameAction
static GameActionreadFromStream (tnstream &stream, GameMap *map)
 

Protected Member Functions

void readData (tnstream &stream)
 
void writeData (tnstream &stream) const
 
GameActionID getID () const
 
ASCString getDescription () const
 
- Protected Member Functions inherited from ContainerCommand
ContainerBasegetContainer (bool dontThrow=false)
 
const ContainerBasegetContainer (bool dontThrow=false) const
 
int getContainerID () const
 
 ContainerCommand (ContainerBase *container)
 
 ContainerCommand (GameMap *map)
 
- Protected Member Functions inherited from Command
 Command (GameMap *gamemap)
 
void setState (State state)
 
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...
 
GameMapgetMap ()
 
const GameMapgetMap () const
 

Friends

template<class Child >
GameActionGameActionCreator (GameMap *map)
 

Additional Inherited Members

- Public Types inherited from Command
enum  State {
  Planned, Evaluated, SetUp, Run,
  Finished, Failed
}
 

Detailed Description

Definition at line 32 of file repairunitcommand.h.

Constructor & Destructor Documentation

RepairUnitCommand::RepairUnitCommand ( ContainerBase servicer)

Definition at line 75 of file repairunitcommand.cpp.

Member Function Documentation

bool RepairUnitCommand::avail ( const ContainerBase servicer)
static

Definition at line 43 of file repairunitcommand.cpp.

References availExternally(), and availInternally().

Referenced by go(), repairUnit(), and testManualRepair().

bool RepairUnitCommand::availExternally ( const Vehicle servicer)
static
bool RepairUnitCommand::availInternally ( const ContainerBase servicer)
static
ActionResult RepairUnitCommand::checkExecutionPrecondition ( ) const
virtual

Reimplemented from ContainerCommand.

Definition at line 243 of file repairunitcommand.cpp.

References ContainerCommand::getContainer(), and GameAction::getMap().

ASCString RepairUnitCommand::getCommandString ( ) const
virtual

Implements Command.

Definition at line 220 of file repairunitcommand.cpp.

References ASCString::format(), and ContainerCommand::getContainerID().

ASCString RepairUnitCommand::getDescription ( ) const
protectedvirtual
vector< Vehicle * > RepairUnitCommand::getExternalTargets ( )
GameActionID RepairUnitCommand::getID ( ) const
protectedvirtual

Implements GameAction.

Definition at line 228 of file repairunitcommand.cpp.

References ActionRegistry::RepairUnitCommand.

vector< Vehicle * > RepairUnitCommand::getInternalTargets ( )
const ContainerBase* RepairUnitCommand::getRepairingUnit ( ) const
inline

Definition at line 66 of file repairunitcommand.h.

References ContainerCommand::getContainer().

Referenced by GuiFunctions::RepairUnit::getName().

ActionResult RepairUnitCommand::go ( const Context context)
virtual
void RepairUnitCommand::readData ( tnstream stream)
protectedvirtual
void RepairUnitCommand::setTarget ( Vehicle target)
bool RepairUnitCommand::validTarget ( const Vehicle target)
void RepairUnitCommand::writeData ( tnstream stream) const
protectedvirtual

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: