#include <changecontainerproperty.h>
Inheritance diagram for ChangeContainerProperty:

Public Types | |
| enum | Property { Damage, RepairedThisTurn } |
Public Member Functions | |
| ChangeContainerProperty (ContainerBase *container, Property property, int value, bool valueIsAbsolute=true) | |
| ASCString | getDescription () const |
Protected Member Functions | |
| virtual GameActionID | getID () const |
| virtual ActionResult | runAction (const Context &context) |
| virtual ActionResult | undoAction (const Context &context) |
| virtual ActionResult | preCheck () |
| preCheck is called before an action is redone and should check the preconditions for the action. | |
| 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. | |
| virtual void | readData (tnstream &stream) |
| virtual void | writeData (tnstream &stream) const |
Friends | |
| template<class Child> | |
| GameAction * | GameActionCreator (GameMap *map) |
Definition at line 29 of file changecontainerproperty.h.
| ChangeContainerProperty::ChangeContainerProperty | ( | ContainerBase * | container, | |
| Property | property, | |||
| int | value, | |||
| bool | valueIsAbsolute = true | |||
| ) |
Definition at line 25 of file changecontainerproperty.cpp.
| ASCString ChangeContainerProperty::getDescription | ( | ) | const [virtual] |
Implements GameAction.
Definition at line 43 of file changecontainerproperty.cpp.
References ContainerAction::getContainer(), ContainerBase::getName(), and ASCString::toString().
| GameActionID ChangeContainerProperty::getID | ( | ) | const [protected, virtual] |
Implements GameAction.
Definition at line 86 of file changecontainerproperty.cpp.
References ActionRegistry::ChangeContainerProperty.
| ActionResult ChangeContainerProperty::runAction | ( | const Context & | context | ) | [protected, virtual] |
| ActionResult ChangeContainerProperty::undoAction | ( | const Context & | context | ) | [protected, virtual] |
| ActionResult ChangeContainerProperty::preCheck | ( | ) | [protected, virtual] |
preCheck is called before an action is redone and should check the preconditions for the action.
The map should be in exactly the same state as it was when the action was first run. This method should check various key indicators to insurce the unmodifiedness of the map. The cheat detection of Replays heavily relies on this mechanism.
Reimplemented from GameAction.
Definition at line 137 of file changecontainerproperty.cpp.
References ContainerAction::getContainer().
| ActionResult ChangeContainerProperty::postCheck | ( | ) | [protected, virtual] |
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.
The cheat detection of Replays heavily relies on this mechanism.
Reimplemented from GameAction.
Definition at line 145 of file changecontainerproperty.cpp.
References ContainerAction::getContainer().
| void ChangeContainerProperty::readData | ( | tnstream & | stream | ) | [protected, virtual] |
Reimplemented from ContainerAction.
Definition at line 58 of file changecontainerproperty.cpp.
References ContainerAction::readData(), and tnstream::readInt().
| void ChangeContainerProperty::writeData | ( | tnstream & | stream | ) | const [protected, virtual] |
Reimplemented from ContainerAction.
Definition at line 74 of file changecontainerproperty.cpp.
References ContainerAction::writeData(), and tnstream::writeInt().
| GameAction* GameActionCreator | ( | GameMap * | map | ) | [friend] |
1.5.1