DestructBuildingCommand Class Reference

#include <destructbuildingcommand.h>

Inheritance diagram for DestructBuildingCommand:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 DestructBuildingCommand (Vehicle *unit)
ActionResult go (const Context &context)
ASCString getCommandString () const
vector< MapCoordinategetFields ()
bool isFieldUsable (const MapCoordinate &pos)
void setTargetPosition (const MapCoordinate &pos)

Static Public Member Functions

static bool avail (const Vehicle *eht)

Protected Member Functions

void readData (tnstream &stream)
void writeData (tnstream &stream) const
GameActionID getID () const
ASCString getDescription () const
bool buildingFits (const MapCoordinate &entry)

Friends

template<class Child>
GameActionGameActionCreator (GameMap *map)

Detailed Description

Definition at line 32 of file destructbuildingcommand.h.


Constructor & Destructor Documentation

DestructBuildingCommand::DestructBuildingCommand ( Vehicle unit  ) 

Definition at line 56 of file destructbuildingcommand.cpp.


Member Function Documentation

bool DestructBuildingCommand::avail ( const Vehicle eht  )  [static]

Definition at line 41 of file destructbuildingcommand.cpp.

References GameMap::actplayer, Vehicle::attacked, VehicleType::buildingsBuildable, ContainerBaseType::ConstructBuildings, destruct_building_fuel_usage, Resources::fuel, VehicleType::fuelConsumption, ContainerBase::getMap(), ContainerBase::getOwner(), Vehicle::getTank(), ContainerBaseType::hasFunction(), Vehicle::hasMoved(), and Vehicle::typ.

Referenced by GuiFunctions::DestructBuilding::available(), and unitDestructBuilding().

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

Reimplemented from UnitCommand.

Definition at line 162 of file destructbuildingcommand.cpp.

References DestructBuildingCommandVersion, MapCoordinate::read(), UnitCommand::readData(), and tnstream::readInt().

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

Reimplemented from UnitCommand.

Definition at line 171 of file destructbuildingcommand.cpp.

References DestructBuildingCommandVersion, MapCoordinate::write(), UnitCommand::writeData(), and tnstream::writeInt().

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

Implements GameAction.

Definition at line 187 of file destructbuildingcommand.cpp.

References ActionRegistry::DestructBuildingCommand.

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

Implements GameAction.

Definition at line 192 of file destructbuildingcommand.cpp.

References Vehicle::getName(), UnitCommand::getUnit(), and MapCoordinate::toString().

bool DestructBuildingCommand::buildingFits ( const MapCoordinate entry  )  [protected]

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

Implements Command.

Definition at line 107 of file destructbuildingcommand.cpp.

References ChangeUnitProperty::AttackedFlag, MapField::building, ActionRegistry::ChangeUnitMovement, ActionRegistry::ChangeUnitProperty, ActionRegistry::ConsumeResource, ActionRegistry::DestructContainer, Context::display, evaluateviewcalculation(), GameMap::getField(), GameAction::getMap(), Command::getState(), UnitCommand::getUnit(), MapDisplayInterface::repaintDisplay(), Command::SetUp, ActionResult::successful(), Building::typ, and ContainerBaseType::view.

ASCString DestructBuildingCommand::getCommandString (  )  const [virtual]

Implements Command.

Definition at line 180 of file destructbuildingcommand.cpp.

References ASCString::format(), UnitCommand::getUnitID(), MapCoordinate::x, and MapCoordinate::y.

vector< MapCoordinate > DestructBuildingCommand::getFields (  ) 

Definition at line 71 of file destructbuildingcommand.cpp.

References MapField::building, BuildingType::buildingNotRemovable, GameMap::getField(), getFirstBit(), getheightdelta(), GameAction::getMap(), getNeighbouringFieldCoordinate(), Vehicle::getPosition(), UnitCommand::getUnit(), ContainerBaseType::height, Vehicle::height, and Building::typ.

Referenced by isFieldUsable().

bool DestructBuildingCommand::isFieldUsable ( const MapCoordinate pos  ) 

Definition at line 86 of file destructbuildingcommand.cpp.

References getFields().

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

void DestructBuildingCommand::setTargetPosition ( const MapCoordinate pos  ) 

Definition at line 93 of file destructbuildingcommand.cpp.

References GameMap::getField(), GameAction::getMap(), Command::setState(), and Command::SetUp.

Referenced by trunreplay::execnextreplaymove(), and GuiFunctions::DestructBuilding::execute().


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