RecycleUnitCommand Class Reference

#include <recycleunitcommand.h>

Inheritance diagram for RecycleUnitCommand:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 RecycleUnitCommand (ContainerBase *carrier)
ActionResult go (const Context &context)
ASCString getCommandString () const
void setUnit (Vehicle *unit)

Static Public Member Functions

static bool avail (const ContainerBase *carrier, const Vehicle *unit)
static Resources getOutput (const ContainerBase *carrier, const Vehicle *unit)

Protected Member Functions

void readData (tnstream &stream)
void writeData (tnstream &stream) const
GameActionID getID () const
ASCString getDescription () const

Friends

template<class Child>
GameActionGameActionCreator (GameMap *map)

Detailed Description

Definition at line 32 of file recycleunitcommand.h.


Constructor & Destructor Documentation

RecycleUnitCommand::RecycleUnitCommand ( ContainerBase carrier  ) 

Definition at line 75 of file recycleunitcommand.cpp.


Member Function Documentation

bool RecycleUnitCommand::avail ( const ContainerBase carrier,
const Vehicle unit 
) [static]

Definition at line 37 of file recycleunitcommand.cpp.

References ContainerBase::findUnit(), ContainerBase::isBuilding(), and Vehicle::networkid.

Referenced by CargoGuiFunctions::RecycleUnitCommandButton::available(), getOutput(), go(), and recycleUnit().

Resources RecycleUnitCommand::getOutput ( const ContainerBase carrier,
const Vehicle unit 
) [static]

Definition at line 52 of file recycleunitcommand.cpp.

References avail(), ContainerBase::baseType, ContainerBase::damage, destructoutput, ContainerBase::getCargo(), ContainerBaseType::hasFunction(), Resources::material, ContainerBaseType::productionCost, ContainerBaseType::RecycleUnits, recyclingoutput, and Vehicle::typ.

Referenced by CargoGuiFunctions::RecycleUnitCommandButton::getName(), and go().

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

Reimplemented from ContainerCommand.

Definition at line 133 of file recycleunitcommand.cpp.

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

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

Reimplemented from ContainerCommand.

Definition at line 142 of file recycleunitcommand.cpp.

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

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

Implements GameAction.

Definition at line 164 of file recycleunitcommand.cpp.

References ActionRegistry::RecycleUnitCommand.

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

Implements GameAction.

Definition at line 169 of file recycleunitcommand.cpp.

References ContainerCommand::getContainer(), GameAction::getMap(), ContainerBase::getName(), Vehicle::getName(), and GameMap::getUnit().

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

Implements Command.

Definition at line 85 of file recycleunitcommand.cpp.

References Context::actingPlayer, avail(), ActionRegistry::ConsumeResource, ActionRegistry::DestructContainer, GameAction::execute(), Command::Failed, Command::Finished, ContainerCommand::getContainer(), GameAction::getMap(), getOutput(), Player::getPosition(), Command::getState(), GameMap::getUnit(), ContainerBase::putResource(), ActionRegistry::ServiceCommand, Command::setState(), Command::SetUp, and ActionResult::successful().

ASCString RecycleUnitCommand::getCommandString (  )  const [virtual]

Implements Command.

Definition at line 156 of file recycleunitcommand.cpp.

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

void RecycleUnitCommand::setUnit ( Vehicle unit  ) 

Definition at line 149 of file recycleunitcommand.cpp.

References Vehicle::networkid, Command::setState(), and Command::SetUp.

Referenced by testRecycling().


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:47:19 2012 for Advanced Strategic Command by  doxygen 1.5.1