PowerGenerationSwitchCommand Class Reference

#include <powergenerationswitchcommand.h>

Inheritance diagram for PowerGenerationSwitchCommand:

Inheritance graph
[legend]
List of all members.

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>
GameActionGameActionCreator (GameMap *map)

Detailed Description

Definition at line 32 of file powergenerationswitchcommand.h.


Constructor & Destructor Documentation

PowerGenerationSwitchCommand::PowerGenerationSwitchCommand ( Vehicle carrier  ) 

Definition at line 49 of file powergenerationswitchcommand.cpp.


Member Function Documentation

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.


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