#include <cargomovecommand.h>
Inheritance diagram for CargoMoveCommand:

Public Types | |
| enum | Mode { undefined, moveInwards, moveOutwards } |
Public Member Functions | |
| CargoMoveCommand (Vehicle *unit) | |
| void | setMode (Mode mode) |
| ActionResult | go (const Context &context) |
| ASCString | getCommandString () const |
| void | setTargetCarrier (Vehicle *targetCarrier) |
| vector< Vehicle * > | getTargetCarriers () |
Static Public Member Functions | |
| static bool | moveOutAvail (const Vehicle *movingUnit) |
| static bool | moveInAvail (const Vehicle *movingUnit, Vehicle *newCarrier) |
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 28 of file cargomovecommand.h.
| CargoMoveCommand::CargoMoveCommand | ( | Vehicle * | unit | ) |
Definition at line 73 of file cargomovecommand.cpp.
| bool CargoMoveCommand::moveOutAvail | ( | const Vehicle * | movingUnit | ) | [static] |
Definition at line 32 of file cargomovecommand.cpp.
References ContainerBase::getCarrier(), and ContainerBase::vehicleFit().
Referenced by CargoGuiFunctions::MoveUnitUp::available(), cargoUnitMove(), and go().
Definition at line 47 of file cargomovecommand.cpp.
References ContainerBase::vehicleFit().
Referenced by cargoUnitMove(), getTargetCarriers(), and go().
| void CargoMoveCommand::readData | ( | tnstream & | stream | ) | [protected, virtual] |
Reimplemented from UnitCommand.
Definition at line 138 of file cargomovecommand.cpp.
References CargoMoveCommandVersion, UnitCommand::readData(), and tnstream::readInt().
| void CargoMoveCommand::writeData | ( | tnstream & | stream | ) | const [protected, virtual] |
Reimplemented from UnitCommand.
Definition at line 148 of file cargomovecommand.cpp.
References CargoMoveCommandVersion, UnitCommand::writeData(), and tnstream::writeInt().
| GameActionID CargoMoveCommand::getID | ( | ) | const [protected, virtual] |
Implements GameAction.
Definition at line 183 of file cargomovecommand.cpp.
References ActionRegistry::CargoMoveCommand.
| ASCString CargoMoveCommand::getDescription | ( | ) | const [protected, virtual] |
Implements GameAction.
Definition at line 188 of file cargomovecommand.cpp.
References Vehicle::getName(), Vehicle::getPosition(), UnitCommand::getUnit(), UnitCommand::getUnitID(), moveOutwards, MapCoordinate::toString(), and ASCString::toString().
| void CargoMoveCommand::setMode | ( | Mode | mode | ) |
Definition at line 128 of file cargomovecommand.cpp.
References moveOutwards, Command::setState(), and Command::SetUp.
Referenced by trunreplay::execnextreplaymove().
| ActionResult CargoMoveCommand::go | ( | const Context & | context | ) | [virtual] |
Implements Command.
Definition at line 83 of file cargomovecommand.cpp.
References GameAction::execute(), ContainerBase::getCarrier(), GameAction::getMap(), ContainerBase::getPosition(), Command::getState(), GameMap::getUnit(), UnitCommand::getUnit(), moveInAvail(), moveOutAvail(), moveOutwards, UnitFieldRegistration::RegisterInCarrier, Command::SetUp, ActionResult::successful(), undefined, ActionRegistry::UnitFieldRegistration, and UnitFieldRegistration::UnRegisterFromCarrier.
| ASCString CargoMoveCommand::getCommandString | ( | ) | const [virtual] |
Implements Command.
Definition at line 168 of file cargomovecommand.cpp.
References ASCString::format(), UnitCommand::getUnitID(), moveInwards, and moveOutwards.
| void CargoMoveCommand::setTargetCarrier | ( | Vehicle * | targetCarrier | ) |
Definition at line 157 of file cargomovecommand.cpp.
References moveInwards, Vehicle::networkid, Command::setState(), and Command::SetUp.
Definition at line 56 of file cargomovecommand.cpp.
References ContainerBase::getCargo(), ContainerBase::getCarrier(), UnitCommand::getUnit(), and moveInAvail().
Referenced by CargoGuiFunctions::MoveUnitIntoInnerContainer::available().
| GameAction* GameActionCreator | ( | GameMap * | map | ) | [friend] |
1.5.1