ServiceCommand Class Reference

#include <servicecommand.h>

Inheritance diagram for ServiceCommand:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 ServiceCommand (ContainerBase *unit)
TransferHandlergetTransferHandler ()
 each call to getTransferHandler will deallocate the previous handler and create a new one Make sure to not have any pointers to the old one around when calling this another time
const ServiceTargetSearcher::TargetsgetDestinations ()
void setDestination (ContainerBase *destination)
void saveTransfers ()
ActionResult go (const Context &context)
ASCString getCommandString () const
ContainerBasegetRefueller ()
ActionResult checkExecutionPrecondition () const
 ~ServiceCommand ()

Static Public Member Functions

static bool availExternally (ContainerBase *source)
static bool avail (ContainerBase *source, ContainerBase *target)

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 servicecommand.h.


Constructor & Destructor Documentation

ServiceCommand::ServiceCommand ( ContainerBase unit  ) 

Definition at line 63 of file servicecommand.cpp.

ServiceCommand::~ServiceCommand (  ) 

Definition at line 254 of file servicecommand.cpp.


Member Function Documentation

bool ServiceCommand::availExternally ( ContainerBase source  )  [static]

Definition at line 39 of file servicecommand.cpp.

References ServiceTargetSearcher::checkAmmo, ServiceTargetSearcher::checkResources, and ServiceTargetSearcher::externallyAvailable().

Referenced by GuiFunctions::RefuelUnitCommand::available().

bool ServiceCommand::avail ( ContainerBase source,
ContainerBase target 
) [static]

Definition at line 45 of file servicecommand.cpp.

References ServiceTargetSearcher::checkAmmo, ServiceTargetSearcher::checkResources, ServiceTargetSearcher::externallyAvailable(), ContainerBase::getCarrier(), and ServiceTargetSearcher::getTargets().

Referenced by autoTrainer().

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

Reimplemented from ContainerCommand.

Definition at line 162 of file servicecommand.cpp.

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

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

Reimplemented from ContainerCommand.

Definition at line 190 of file servicecommand.cpp.

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

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

Implements GameAction.

Definition at line 230 of file servicecommand.cpp.

References ActionRegistry::ServiceCommand.

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

Implements GameAction.

Definition at line 235 of file servicecommand.cpp.

References ContainerCommand::getContainer(), and ContainerBase::getName().

TransferHandler & ServiceCommand::getTransferHandler (  ) 

each call to getTransferHandler will deallocate the previous handler and create a new one Make sure to not have any pointers to the old one around when calling this another time

Definition at line 93 of file servicecommand.cpp.

References ContainerCommand::getContainer(), and TransferHandler::getTransfers().

Referenced by AmmoTransferWindow::AmmoTransferWindow(), GuiFunctions::RefuelUnitCommand::execute(), and go().

const ServiceTargetSearcher::Targets & ServiceCommand::getDestinations (  ) 

Definition at line 69 of file servicecommand.cpp.

References ServiceTargetSearcher::checkAmmo, ServiceTargetSearcher::checkResources, ContainerCommand::getContainer(), ServiceTargetSearcher::getTargets(), and ServiceTargetSearcher::startSearch().

Referenced by GuiFunctions::RefuelUnitDialogCommand::available(), and GuiFunctions::RefuelUnitCommand::available().

void ServiceCommand::setDestination ( ContainerBase destination  ) 

Definition at line 77 of file servicecommand.cpp.

References ContainerBase::getIdentification().

Referenced by GuiFunctions::RefuelUnitDialogCommand::execute(), and GuiFunctions::RefuelUnitCommand::execute().

void ServiceCommand::saveTransfers (  ) 

Definition at line 110 of file servicecommand.cpp.

References TransferHandler::getTransfers(), Command::setState(), and Command::SetUp.

Referenced by GuiFunctions::RefuelUnitCommand::execute().

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

Implements Command.

Definition at line 123 of file servicecommand.cpp.

References Command::Finished, Command::getState(), getTransferHandler(), TransferHandler::getTransfers(), Command::setState(), and Command::SetUp.

ASCString ServiceCommand::getCommandString (  )  const [virtual]

Implements Command.

Definition at line 213 of file servicecommand.cpp.

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

ContainerBase* ServiceCommand::getRefueller (  )  [inline]

Definition at line 78 of file servicecommand.h.

References ContainerCommand::getContainer().

Referenced by GuiFunctions::RefuelUnitDialogCommand::execute().

ActionResult ServiceCommand::checkExecutionPrecondition (  )  const [virtual]

Reimplemented from ContainerCommand.

Definition at line 245 of file servicecommand.cpp.

References ContainerCommand::getContainer(), and GameAction::getMap().


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