#include <powergenerationswitchcommand.h>
Inheritance diagram for PowerGenerationSwitchCommand:

Public Member Functions | |
| PowerGenerationSwitchCommand (Vehicle *carrier) | |
| ActionResult | go (const Context &context) |
| ASCString | getCommandString () const |
| void | setNewState (bool enabled) |
Static Public Member Functions | |
| static bool | avail (const Vehicle *unit, bool newState) |
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 powergenerationswitchcommand.h.
| PowerGenerationSwitchCommand::PowerGenerationSwitchCommand | ( | Vehicle * | carrier | ) |
Definition at line 49 of file powergenerationswitchcommand.cpp.
| bool PowerGenerationSwitchCommand::avail | ( | const Vehicle * | unit, | |
| bool | newState | |||
| ) | [static] |
Definition at line 34 of file powergenerationswitchcommand.cpp.
References GameMap::actplayer, Vehicle::getGeneratorStatus(), ContainerBase::getMap(), ContainerBase::getOwner(), ContainerBaseType::hasFunction(), ContainerBaseType::MatterConverter, and Vehicle::typ.
Referenced by GuiFunctions::PowerSwitch::available(), go(), and unitPowerGenerationEnable().
| void PowerGenerationSwitchCommand::readData | ( | tnstream & | stream | ) | [protected, virtual] |
Reimplemented from UnitCommand.
Definition at line 85 of file powergenerationswitchcommand.cpp.
References PowerGenerationSwitchCommandVersion, UnitCommand::readData(), and tnstream::readInt().
| void PowerGenerationSwitchCommand::writeData | ( | tnstream & | stream | ) | const [protected, virtual] |
Reimplemented from UnitCommand.
Definition at line 94 of file powergenerationswitchcommand.cpp.
References PowerGenerationSwitchCommandVersion, UnitCommand::writeData(), and tnstream::writeInt().
| GameActionID PowerGenerationSwitchCommand::getID | ( | ) | const [protected, virtual] |
Implements GameAction.
Definition at line 110 of file powergenerationswitchcommand.cpp.
References ActionRegistry::PowerGenerationSwitchCommand.
| ASCString PowerGenerationSwitchCommand::getDescription | ( | ) | const [protected, virtual] |
Implements GameAction.
Definition at line 115 of file powergenerationswitchcommand.cpp.
References GameAction::getMap(), Vehicle::getName(), GameMap::getUnit(), UnitCommand::getUnit(), and UnitCommand::getUnitID().
| ActionResult PowerGenerationSwitchCommand::go | ( | const Context & | context | ) | [virtual] |
Implements Command.
Definition at line 63 of file powergenerationswitchcommand.cpp.
References avail(), ActionRegistry::ChangeUnitProperty, Command::getState(), UnitCommand::getUnit(), ChangeUnitProperty::PowerGeneration, Command::SetUp, and ActionResult::successful().
| ASCString PowerGenerationSwitchCommand::getCommandString | ( | ) | const [virtual] |
Implements Command.
Definition at line 102 of file powergenerationswitchcommand.cpp.
References ASCString::format(), and UnitCommand::getUnitID().
| void PowerGenerationSwitchCommand::setNewState | ( | bool | enabled | ) |
Definition at line 54 of file powergenerationswitchcommand.cpp.
References Command::setState(), and Command::SetUp.
| GameAction* GameActionCreator | ( | GameMap * | map | ) | [friend] |
1.5.1