#include <moveunit.h>
Inheritance diagram for MoveUnit:

Public Member Functions | |
| MoveUnit (Vehicle *veh, AStar3D::Path &pathToMove, bool dontInterrupt=false) | |
| 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 moveunit.h.
| MoveUnit::MoveUnit | ( | Vehicle * | veh, | |
| AStar3D::Path & | pathToMove, | |||
| bool | dontInterrupt = false | |||
| ) |
| ASCString MoveUnit::getDescription | ( | ) | const [virtual] |
Implements GameAction.
Definition at line 68 of file moveunit.cpp.
References Vehicle::getName(), and UnitAction::getUnit().
| GameActionID MoveUnit::getID | ( | ) | const [protected, virtual] |
Implements GameAction.
Definition at line 106 of file moveunit.cpp.
References ActionRegistry::MoveUnit.
| ActionResult MoveUnit::runAction | ( | const Context & | context | ) | [protected, virtual] |
Implements GameAction.
Definition at line 112 of file moveunit.cpp.
References Context::actingPlayer, SoundLoopManager::activate(), UnitFieldRegistration::AddView, beeline(), MapField::building, calcMoveMalus(), cconnection_areaentered_anyunit, cconnection_areaentered_specificunit, cgp_initialMapVisibility, ActionRegistry::ChangeUnitMovement, ActionRegistry::ChangeUnitProperty, ActionRegistry::ChangeView, treactionfire::checkfield(), chfliegend, chhochfliegend, chtieffliegend, MapField::connection, SoundList::conquer_building, ActionRegistry::ConsumeResource, ActionRegistry::ConvertContainer, ContainerBaseType::DetectsMineralResources, Player::diplomacy, ChangeUnitProperty::Direction, ActionRegistry::DiscoverResources, Context::display, MapDisplayInterface::displayMap(), MapDisplayInterface::displayMovingUnit(), evaluateviewcalculation(), evaluatevisibilityfield(), GameAction::execute(), SoundLoopManager::fadeOut(), fieldCrossed, fieldvisiblenow(), treactionfire::finalCheck(), MapField::getContainer(), getdirection(), GameMap::getField(), getFirstBit(), SoundList::getInstance(), GameAction::getMap(), Vehicle::getMovement(), getNeighbouringFieldCoordinate(), ContainerBase::getOwner(), GameMap::getPlayer(), GameMap::getPlayerCount(), Player::getPosition(), Vehicle::getPosition(), GameMap::getUnit(), UnitAction::getUnit(), MapDisplayInterface::getUnitMovementDuration(), ChangeUnitProperty::Height, Vehicle::height, ContainerBaseType::height, treactionfire::init(), CGameOptions::Instance(), DiplomaticStateVector::isHostile(), maxmalq, MapField::mineattacks(), MapField::mineowner(), move(), SoundList::moving, ChangeUnitMovement::NONE, ChangeUnitMovement::NORMAL, SoundList::playSound(), printTimer(), UnitFieldRegistration::RegisterOnField, UnitFieldRegistration::RemoveView, MapDisplayInterface::resetMovement(), MapField::secondvehicle, MapCoordinate3D::setnum(), MapDisplayInterface::showBattle(), Vehicle::typ, ActionRegistry::UnitFieldRegistration, UnitFieldRegistration::UnregisterOnField, updateFieldInfo, MapField::vehicle, Context::viewingPlayer, MapField::visible, MapCoordinate::x, and MapCoordinate::y.
| ActionResult MoveUnit::undoAction | ( | const Context & | context | ) | [protected, virtual] |
Implements GameAction.
Definition at line 462 of file moveunit.cpp.
References UnitAction::getUnit(), and Vehicle::setMovement().
| ActionResult MoveUnit::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 470 of file moveunit.cpp.
| ActionResult MoveUnit::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 475 of file moveunit.cpp.
| void MoveUnit::readData | ( | tnstream & | stream | ) | [protected, virtual] |
Reimplemented from UnitAction.
Definition at line 80 of file moveunit.cpp.
References moveUnitStreamVersion, readClassContainerStaticConstructor(), UnitAction::readData(), and tnstream::readInt().
| void MoveUnit::writeData | ( | tnstream & | stream | ) | const [protected, virtual] |
Reimplemented from UnitAction.
Definition at line 96 of file moveunit.cpp.
References moveUnitStreamVersion, writeClassContainer(), UnitAction::writeData(), and tnstream::writeInt().
| GameAction* GameActionCreator | ( | GameMap * | map | ) | [friend] |
1.5.1