Advanced Strategic Command
|
#include <destructcontainer.h>
Public Member Functions | |
DestructContainer (ContainerBase *container, bool suppressWreckage=false) | |
ASCString | getDescription () const |
~DestructContainer () | |
![]() | |
ActionResult | execute (const Context &context) |
ActionResult | undo (const Context &context) |
void | read (tnstream &stream) |
void | write (tnstream &stream) const |
void | write (tnstream &stream, bool persistChildren) const |
virtual | ~GameAction () |
Protected Member Functions | |
virtual GameActionID | getID () const |
virtual ActionResult | runAction (const Context &context) |
virtual ActionResult | undoAction (const Context &context) |
virtual void | readData (tnstream &stream) |
virtual void | writeData (tnstream &stream) const |
![]() | |
void | setID (int id) |
should usually not be called, the ID should only be set through the constructor More... | |
ContainerBase * | getContainer (bool dontThrow=false) |
const ContainerBase * | getContainer (bool dontThrow=false) const |
ContainerAction (ContainerBase *container) | |
ContainerAction (GameMap *map) | |
![]() | |
void | deleteChildren () |
GameAction (GameMap *map) | |
void | addChild (GameAction *action) |
adds a child action. Ownership of the child action is passed to THIS More... | |
virtual ActionResult | preCheck () |
preCheck is called before an action is redone and should check the preconditions for the action. More... | |
virtual ActionResult | postCheck () |
postCheck is called after an action has been redone and should check that the state of the map is exactly the same as it was after the action has been executed the first time. More... | |
virtual bool | undoOrderChildFirst () const |
determines the order in which the child actions are undone. More... | |
GameMap * | getMap () |
const GameMap * | getMap () const |
Friends | |
template<class Child > | |
GameAction * | GameActionCreator (GameMap *map) |
Additional Inherited Members | |
![]() | |
static GameAction * | readFromStream (tnstream &stream, GameMap *map) |
Definition at line 30 of file destructcontainer.h.
DestructContainer::DestructContainer | ( | ContainerBase * | container, |
bool | suppressWreckage = false |
||
) |
Definition at line 30 of file destructcontainer.cpp.
References ContainerBase::isBuilding().
DestructContainer::~DestructContainer | ( | ) |
Definition at line 216 of file destructcontainer.cpp.
|
virtual |
Implements GameAction.
Definition at line 38 of file destructcontainer.cpp.
|
protectedvirtual |
Implements GameAction.
Definition at line 101 of file destructcontainer.cpp.
References ActionRegistry::DestructContainer.
|
protectedvirtual |
Reimplemented from ContainerAction.
Definition at line 46 of file destructcontainer.cpp.
References destructContainerStreamVersion, ContainerAction::readData(), MemoryStreamStorage::readfromstream(), and tnstream::readInt().
|
protectedvirtual |
Implements GameAction.
Definition at line 106 of file destructcontainer.cpp.
References ContainerBase::baseType, GameMap::Destruction, BuildingType::destructionObjects, Vehicle::direction, evaluateviewcalculation(), GameAction::execute(), BuildingType::fieldExists(), ContainerBase::getCargo(), ContainerBase::getCarrier(), ContainerAction::getContainer(), Building::getField(), GameMap::getField(), Building::getFieldCoordinates(), ContainerBase::getIdentification(), GameAction::getMap(), GameMap::getobjecttype_byid(), Vehicle::getPosition(), ContainerBase::getPosition(), Building::isViewing(), Vehicle::isViewing(), Building::removeview(), Vehicle::removeview(), MapField::secondvehicle, ActionRegistry::SpawnObject, GameMap::state, Building::typ, Vehicle::typ, Building::unchainbuildingfromfield(), MapField::vehicle, ContainerBaseType::view, VehicleType::wreckageObject, ContainerBase::write(), tnstream::writing, BuildingType::xdimension, and BuildingType::ydimension.
|
protectedvirtual |
Implements GameAction.
Definition at line 185 of file destructcontainer.cpp.
References ContainerBase::addToCargo(), Building::addview(), Vehicle::addview(), Building::chainbuildingtofield(), GameMap::getContainer(), Building::getEntry(), GameMap::getField(), GameAction::getMap(), ContainerBase::getMap(), ContainerBase::getOwner(), GameMap::getPlayerCount(), Vehicle::getPosition(), Building::newFromStream(), Vehicle::newFromStream(), and tnstream::reading.
|
protectedvirtual |
Reimplemented from ContainerAction.
Definition at line 81 of file destructcontainer.cpp.
References destructContainerStreamVersion, ContainerAction::writeData(), tnstream::writeInt(), and MemoryStreamStorage::writetostream().
|
friend |