#include <changeunitmovement.h>
Inheritance diagram for ChangeUnitMovement:

Public Types | |
| enum | Recursivity { NONE, NORMAL, ALLFULL } |
Public Member Functions | |
| ChangeUnitMovement (Vehicle *veh, int movement, bool delta=false, Recursivity recursive=NORMAL) | |
| changes a unit's movement | |
| 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 changeunitmovement.h.
Definition at line 32 of file changeunitmovement.h.
| ChangeUnitMovement::ChangeUnitMovement | ( | Vehicle * | veh, | |
| int | movement, | |||
| bool | delta = false, |
|||
| Recursivity | recursive = NORMAL | |||
| ) |
changes a unit's movement
| delta,: | true=movement is a relative value which will be subtracted false=movement is the new absolute value |
Definition at line 32 of file changeunitmovement.cpp.
| ASCString ChangeUnitMovement::getDescription | ( | ) | const [virtual] |
Implements GameAction.
Definition at line 41 of file changeunitmovement.cpp.
References Vehicle::getName(), UnitAction::getUnit(), and ASCString::toString().
| GameActionID ChangeUnitMovement::getID | ( | ) | const [protected, virtual] |
Implements GameAction.
Definition at line 87 of file changeunitmovement.cpp.
References ActionRegistry::ChangeUnitMovement.
| ActionResult ChangeUnitMovement::runAction | ( | const Context & | context | ) | [protected, virtual] |
Implements GameAction.
Definition at line 117 of file changeunitmovement.cpp.
References Vehicle::getMovement(), UnitAction::getUnit(), and Vehicle::maxMovement().
| ActionResult ChangeUnitMovement::undoAction | ( | const Context & | context | ) | [protected, virtual] |
| ActionResult ChangeUnitMovement::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 142 of file changeunitmovement.cpp.
References UnitAction::getUnit().
| ActionResult ChangeUnitMovement::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 150 of file changeunitmovement.cpp.
References UnitAction::getUnit().
| void ChangeUnitMovement::readData | ( | tnstream & | stream | ) | [protected, virtual] |
Reimplemented from UnitAction.
Definition at line 57 of file changeunitmovement.cpp.
References changeUnitMovementStreamVersion, NORMAL, UnitAction::readData(), and tnstream::readInt().
| void ChangeUnitMovement::writeData | ( | tnstream & | stream | ) | const [protected, virtual] |
Reimplemented from UnitAction.
Definition at line 75 of file changeunitmovement.cpp.
References changeUnitMovementStreamVersion, UnitAction::writeData(), and tnstream::writeInt().
| GameAction* GameActionCreator | ( | GameMap * | map | ) | [friend] |
1.5.1