PutObjectCommand Class Reference

#include <putobjectcommand.h>

Inheritance diagram for PutObjectCommand:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 PutObjectCommand (Vehicle *unit)
ActionResult searchFields ()
VehiclegetAttacker ()
void setTarget (const MapCoordinate &target, int objectID)
ActionResult go (const Context &context)
ASCString getCommandString () const
const vector< int > & getCreatableObjects (const MapCoordinate &pos)
const vector< int > & getRemovableObjects (const MapCoordinate &pos)
vector< MapCoordinategetFields ()

Static Public Member Functions

static bool avail (Vehicle *eht)

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


Constructor & Destructor Documentation

PutObjectCommand::PutObjectCommand ( Vehicle unit  ) 

Definition at line 50 of file putobjectcommand.cpp.


Member Function Documentation

bool PutObjectCommand::avail ( Vehicle eht  )  [static]

Definition at line 38 of file putobjectcommand.cpp.

References GameMap::actplayer, Vehicle::attacked, ContainerBase::getMap(), ContainerBase::getOwner(), VehicleType::objectGroupsBuildable, VehicleType::objectGroupsRemovable, VehicleType::objectsBuildable, VehicleType::objectsRemovable, and Vehicle::typ.

Referenced by GuiFunctions::BuildObject::available(), go(), and unitPutObject().

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

Reimplemented from UnitCommand.

Definition at line 263 of file putobjectcommand.cpp.

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

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

Reimplemented from UnitCommand.

Definition at line 274 of file putobjectcommand.cpp.

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

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

Implements GameAction.

Definition at line 294 of file putobjectcommand.cpp.

References ActionRegistry::PutObjectCommand.

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

Implements GameAction.

Definition at line 299 of file putobjectcommand.cpp.

References GameAction::getMap(), Vehicle::getName(), GameMap::getobjecttype_byid(), UnitCommand::getUnit(), ObjectType::name, and MapCoordinate::toString().

ActionResult PutObjectCommand::searchFields (  ) 

Definition at line 79 of file putobjectcommand.cpp.

References circularFieldIterator(), Command::Evaluated, GameAction::getMap(), UnitCommand::getUnit(), and Command::setState().

Referenced by go(), and testObjectRemoval().

Vehicle* PutObjectCommand::getAttacker (  )  [inline]

Definition at line 65 of file putobjectcommand.h.

References UnitCommand::getUnit().

void PutObjectCommand::setTarget ( const MapCoordinate target,
int  objectID 
)

Definition at line 178 of file putobjectcommand.cpp.

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

Referenced by GuiFunctions::ObjectBuildingGui::execute(), and testObjectRemoval().

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

Implements Command.

Definition at line 203 of file putobjectcommand.cpp.

References RecalculateAreaView::addView(), avail(), ObjectType::basicjamming_abs, ObjectType::basicjamming_plus, ObjectType::build_movecost, ObjectType::buildcost, ActionRegistry::ChangeUnitMovement, ActionRegistry::ConsumeResource, GameAction::execute(), Command::Failed, Command::Finished, GameAction::getMap(), GameMap::getobjecttype_byid(), Command::getState(), UnitCommand::getUnit(), maxmalq, maxViewRange, ObjectType::remove_movecost, ObjectType::removecost, ActionRegistry::RemoveObject, RecalculateAreaView::removeView(), searchFields(), Command::setState(), Command::SetUp, ActionRegistry::SpawnObject, ActionResult::successful(), ObjectType::viewbonus_abs, and ObjectType::viewbonus_plus.

ASCString PutObjectCommand::getCommandString (  )  const [virtual]

Implements Command.

Definition at line 283 of file putobjectcommand.cpp.

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

const vector< int > & PutObjectCommand::getCreatableObjects ( const MapCoordinate pos  ) 

Definition at line 69 of file putobjectcommand.cpp.

Referenced by GuiFunctions::ObjectBuildingGui::eval().

const vector< int > & PutObjectCommand::getRemovableObjects ( const MapCoordinate pos  ) 

Definition at line 74 of file putobjectcommand.cpp.

Referenced by GuiFunctions::ObjectBuildingGui::eval().

vector< MapCoordinate > PutObjectCommand::getFields (  ) 

Definition at line 57 of file putobjectcommand.cpp.


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