BuildProductionLineCommand Class Reference

#include <buildproductionlinecommand.h>

Inheritance diagram for BuildProductionLineCommand:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 BuildProductionLineCommand (ContainerBase *item)
vector< const VehicleType * > productionLinesBuyable ()
void setProduction (const VehicleType *vehicleType)
ActionResult go (const Context &context)
ASCString getCommandString () const

Static Public Member Functions

static bool avail (const ContainerBase *factory)
static Resources resourcesNeeded (const ContainerBaseType *factory, const VehicleType *veh)

Protected Member Functions

void readData (tnstream &stream)
void writeData (tnstream &stream) const
GameActionID getID () const
ASCString getDescription () const
ActionResult undoAction (const Context &context)

Friends

template<class Child>
GameActionGameActionCreator (GameMap *map)

Detailed Description

Definition at line 32 of file buildproductionlinecommand.h.


Constructor & Destructor Documentation

BuildProductionLineCommand::BuildProductionLineCommand ( ContainerBase item  ) 

Definition at line 80 of file buildproductionlinecommand.cpp.


Member Function Documentation

bool BuildProductionLineCommand::avail ( const ContainerBase factory  )  [static]

Definition at line 37 of file buildproductionlinecommand.cpp.

References ContainerBase::baseType, ContainerBaseType::hasFunction(), ContainerBaseType::InternalVehicleProduction, and ContainerBaseType::NoProductionCustomization.

Referenced by buildProductionLine(), go(), and productionLinesBuyable().

Resources BuildProductionLineCommand::resourcesNeeded ( const ContainerBaseType factory,
const VehicleType veh 
) [static]

Definition at line 73 of file buildproductionlinecommand.cpp.

References ContainerBaseType::productionCost, ContainerBaseType::productionEfficiency, and productionLineConstructionCostFactor.

Referenced by AddProductionLine_SelectionItemFactory::getCost(), and go().

void BuildProductionLineCommand::readData ( tnstream stream  )  [protected, virtual]

Reimplemented from ContainerCommand.

Definition at line 150 of file buildproductionlinecommand.cpp.

References BuildProductionLineCommandVersion, ContainerCommand::readData(), and tnstream::readInt().

void BuildProductionLineCommand::writeData ( tnstream stream  )  const [protected, virtual]

Reimplemented from ContainerCommand.

Definition at line 159 of file buildproductionlinecommand.cpp.

References BuildProductionLineCommandVersion, ContainerCommand::writeData(), and tnstream::writeInt().

GameActionID BuildProductionLineCommand::getID (  )  const [protected, virtual]

Implements GameAction.

Definition at line 175 of file buildproductionlinecommand.cpp.

References ActionRegistry::BuildProductionLineCommand.

ASCString BuildProductionLineCommand::getDescription (  )  const [protected, virtual]

Implements GameAction.

Definition at line 180 of file buildproductionlinecommand.cpp.

References ContainerCommand::getContainer(), ContainerBase::getName(), VehicleType::getName(), ASCString::toString(), and vehicleTypeRepository.

ActionResult BuildProductionLineCommand::undoAction ( const Context context  )  [protected, virtual]

Reimplemented from Command.

Definition at line 136 of file buildproductionlinecommand.cpp.

References ContainerBase::deleteProductionLine(), ContainerCommand::getContainer(), Command::undoAction(), and vehicleTypeRepository.

vector< const VehicleType * > BuildProductionLineCommand::productionLinesBuyable (  ) 

Definition at line 47 of file buildproductionlinecommand.cpp.

References avail(), ContainerBase::baseType, ContainerCommand::getContainer(), GameMap::getCurrentPlayer(), ContainerBase::getMap(), GameAction::getMap(), ContainerBase::getProduction(), ContainerBase::getResource(), GameMap::getvehicletype_bypos(), ContainerBaseType::hasFunction(), maxint, ContainerBaseType::ProduceNonLeavableUnits, Player::research, ContainerBaseType::vehicleCategoriesProduceable, ContainerBaseType::vehicleFit(), vehicleTypeRepository, and ContainerBase::vehicleUnloadable().

Referenced by VehicleProduction_SelectionWindow::addProductionLine(), go(), testresearch1(), and testresearch2().

void BuildProductionLineCommand::setProduction ( const VehicleType vehicleType  ) 

Definition at line 88 of file buildproductionlinecommand.cpp.

References ContainerBaseType::id, Command::setState(), and Command::SetUp.

Referenced by testresearch1().

ActionResult BuildProductionLineCommand::go ( const Context context  )  [virtual]

Implements Command.

Definition at line 97 of file buildproductionlinecommand.cpp.

References ContainerBase::addProductionLine(), avail(), ActionRegistry::ConsumeResource, Command::Failed, Command::Finished, ContainerCommand::getContainer(), ContainerBase::getResource(), Command::getState(), productionLinesBuyable(), resourcesNeeded(), Command::setState(), Command::SetUp, and ActionResult::successful().

ASCString BuildProductionLineCommand::getCommandString (  )  const [virtual]

Implements Command.

Definition at line 167 of file buildproductionlinecommand.cpp.

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


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:
Generated on Mon May 21 01:46:26 2012 for Advanced Strategic Command by  doxygen 1.5.1