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

#include <containercommand.h>

Inheritance diagram for ContainerCommand:
Inheritance graph
[legend]

Protected Member Functions

ContainerBasegetContainer (bool dontThrow=false)
 
const ContainerBasegetContainer (bool dontThrow=false) const
 
int getContainerID () const
 
void readData (tnstream &stream)
 
void writeData (tnstream &stream) const
 
 ContainerCommand (ContainerBase *container)
 
 ContainerCommand (GameMap *map)
 
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
}
 
- Public Member Functions inherited from Command
State getState () const
 
virtual ASCString getCommandString () const =0
 
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 ASCString getDescription () const =0
 
virtual ~GameAction ()
 
- Static Public Member Functions inherited from GameAction
static GameActionreadFromStream (tnstream &stream, GameMap *map)
 

Detailed Description

Definition at line 29 of file containercommand.h.

Constructor & Destructor Documentation

ContainerCommand::ContainerCommand ( ContainerBase container)
protected

Definition at line 27 of file containercommand.cpp.

References ContainerBase::getIdentification().

ContainerCommand::ContainerCommand ( GameMap map)
protected

Definition at line 33 of file containercommand.cpp.

Member Function Documentation

ActionResult ContainerCommand::checkExecutionPrecondition ( ) const
protectedvirtual

Reimplemented from Command.

Reimplemented in ServiceCommand, and RepairUnitCommand.

Definition at line 77 of file containercommand.cpp.

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

ContainerBase * ContainerCommand::getContainer ( bool  dontThrow = false)
protected

Definition at line 41 of file containercommand.cpp.

References GameMap::getContainer(), GameAction::getMap(), and ASCString::toString().

Referenced by DestructUnitCommand::avail(), checkExecutionPrecondition(), RepairUnitCommand::checkExecutionPrecondition(), ServiceCommand::checkExecutionPrecondition(), RepairBuildingCommand::getCost(), DestructUnitCommand::getDescription(), RepairBuildingCommand::getDescription(), RecycleUnitCommand::getDescription(), RemoveProductionLineCommand::getDescription(), SetResourceProcessingRateCommand::getDescription(), BuildProductionLineCommand::getDescription(), TransferControlCommand::getDescription(), RenameContainerCommand::getDescription(), RepairUnitCommand::getDescription(), ConstructUnitCommand::getDescription(), ServiceCommand::getDescription(), ServiceCommand::getDestinations(), RepairUnitCommand::getExternalTargets(), ConstructUnitCommand::getFields(), RepairUnitCommand::getInternalTargets(), SetResourceProcessingRateCommand::getNewPlus(), ConstructUnitCommand::getProduceableVehicles(), TransferControlCommand::getReceivers(), ServiceCommand::getRefueller(), RepairUnitCommand::getRepairingUnit(), ServiceCommand::getTransferHandler(), DestructUnitCommand::go(), TrainUnitCommand::go(), RecycleUnitCommand::go(), RepairUnitCommand::go(), TransferControlCommand::go(), SetResourceProcessingRateCommand::go(), RepairBuildingCommand::go(), RenameContainerCommand::go(), RemoveProductionLineCommand::go(), ConstructUnitCommand::go(), BuildProductionLineCommand::go(), BuildProductionLineCommand::productionLinesBuyable(), ConstructUnitCommand::setMode(), RemoveProductionLineCommand::undoAction(), SetResourceProcessingRateCommand::undoAction(), BuildProductionLineCommand::undoAction(), RenameContainerCommand::undoAction(), ConstructUnitCommand::unitProductionPrerequisites(), and RepairUnitCommand::validTarget().

const ContainerBase * ContainerCommand::getContainer ( bool  dontThrow = false) const
protected
int ContainerCommand::getContainerID ( ) const
inlineprotected
void ContainerCommand::readData ( tnstream stream)
protectedvirtual
void ContainerCommand::writeData ( tnstream stream) const
protectedvirtual

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