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

#include <constructbuildingcommand.h>

Inheritance diagram for ConstructBuildingCommand:
Inheritance graph


class  Lack
class  ProductionEntry

Public Types

typedef vector
< ConstructBuildingCommand::ProductionEntry
- Public Types inherited from Command
enum  State {
  Planned, Evaluated, SetUp, Run,
  Finished, Failed

Public Member Functions

 ConstructBuildingCommand (Vehicle *unit)
ActionResult go (const Context &context)
ASCString getCommandString () const
Lack buildingProductionPrerequisites (const BuildingType *type) const
Producables getProduceableBuildings ()
void setBuildingType (const BuildingType *type)
vector< MapCoordinategetFields ()
bool isFieldUsable (const MapCoordinate &pos)
BuildinggetProducedBuilding ()
void setTargetPosition (const MapCoordinate &pos)
- Public Member Functions inherited from UnitCommand
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
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 ~GameAction ()

Static Public Member Functions

static bool avail (const Vehicle *eht)
- 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
bool buildingFits (const MapCoordinate &entry)
- Protected Member Functions inherited from UnitCommand
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 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


template<class Child >
GameActionGameActionCreator (GameMap *map)

Detailed Description

Definition at line 32 of file constructbuildingcommand.h.

Member Typedef Documentation

Definition at line 86 of file constructbuildingcommand.h.

Constructor & Destructor Documentation

ConstructBuildingCommand::ConstructBuildingCommand ( Vehicle unit)

Definition at line 58 of file constructbuildingcommand.cpp.

Member Function Documentation

bool ConstructBuildingCommand::avail ( const Vehicle eht)
bool ConstructBuildingCommand::buildingFits ( const MapCoordinate entry)
ConstructBuildingCommand::Lack ConstructBuildingCommand::buildingProductionPrerequisites ( const BuildingType type) const
ASCString ConstructBuildingCommand::getCommandString ( ) const
ASCString ConstructBuildingCommand::getDescription ( ) const
vector< MapCoordinate > ConstructBuildingCommand::getFields ( )
GameActionID ConstructBuildingCommand::getID ( ) const

Implements GameAction.

Definition at line 310 of file constructbuildingcommand.cpp.

References ActionRegistry::ConstructBuildingCommand.

ConstructBuildingCommand::Producables ConstructBuildingCommand::getProduceableBuildings ( )
Building * ConstructBuildingCommand::getProducedBuilding ( )

Definition at line 271 of file constructbuildingcommand.cpp.

ActionResult ConstructBuildingCommand::go ( const Context context)
bool ConstructBuildingCommand::isFieldUsable ( const MapCoordinate pos)

Definition at line 191 of file constructbuildingcommand.cpp.

References getFields().

Referenced by GuiFunctions::ConstructBuilding::available(), and go().

void ConstructBuildingCommand::readData ( tnstream stream)

Reimplemented from Command.

Definition at line 279 of file constructbuildingcommand.cpp.

References MapCoordinate::read(), UnitCommand::readData(), and tnstream::readInt().

void ConstructBuildingCommand::setBuildingType ( const BuildingType type)

Definition at line 297 of file constructbuildingcommand.cpp.

References ContainerBaseType::id.

void ConstructBuildingCommand::setTargetPosition ( const MapCoordinate pos)
void ConstructBuildingCommand::writeData ( tnstream stream) const

Reimplemented from Command.

Definition at line 289 of file constructbuildingcommand.cpp.

References MapCoordinate::write(), UnitCommand::writeData(), 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: