#include <recycleunitcommand.h>
Inheritance diagram for RecycleUnitCommand:

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> | |
| GameAction * | GameActionCreator (GameMap *map) |
Definition at line 32 of file recycleunitcommand.h.
| RecycleUnitCommand::RecycleUnitCommand | ( | ContainerBase * | carrier | ) |
Definition at line 75 of file recycleunitcommand.cpp.
| 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().
| GameAction* GameActionCreator | ( | GameMap * | map | ) | [friend] |
1.5.1