Advanced Strategic Command
Public Member Functions | Protected Member Functions | Friends | List of all members
MoveUnit Class Reference

#include <moveunit.h>

Inheritance diagram for MoveUnit:
Inheritance graph
[legend]

Public Member Functions

 MoveUnit (Vehicle *veh, AStar3D::Path &pathToMove, bool dontInterrupt=false)
 
ASCString getDescription () const
 
- Public Member Functions inherited from GameAction
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 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 void readData (tnstream &stream)
 
virtual void writeData (tnstream &stream) const
 
- Protected Member Functions inherited from UnitAction
VehiclegetUnit (bool dontThrow=false)
 
const VehiclegetUnit (bool dontThrow=false) const
 
void readData (tnstream &stream)
 
void writeData (tnstream &stream) const
 
 UnitAction (GameMap *gamemap, int vehicleID)
 
 UnitAction (Vehicle *unit)
 
 UnitAction (GameMap *gamemap)
 
- Protected Member Functions inherited from GameAction
void deleteChildren ()
 
 GameAction (GameMap *map)
 
void addChild (GameAction *action)
 adds a child action. Ownership of the child action is passed to THIS More...
 
virtual bool undoOrderChildFirst () const
 determines the order in which the child actions are undone. More...
 
GameMapgetMap ()
 
const GameMapgetMap () const
 

Friends

template<class Child >
GameActionGameActionCreator (GameMap *map)
 

Additional Inherited Members

- Static Public Member Functions inherited from GameAction
static GameActionreadFromStream (tnstream &stream, GameMap *map)
 

Detailed Description

Definition at line 29 of file moveunit.h.

Constructor & Destructor Documentation

MoveUnit::MoveUnit ( Vehicle veh,
AStar3D::Path pathToMove,
bool  dontInterrupt = false 
)

Definition at line 59 of file moveunit.cpp.

References Vehicle::getMovement().

Member Function Documentation

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
protectedvirtual

Implements GameAction.

Definition at line 106 of file moveunit.cpp.

References ActionRegistry::MoveUnit.

ActionResult MoveUnit::postCheck ( )
protectedvirtual

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 478 of file moveunit.cpp.

ActionResult MoveUnit::preCheck ( )
protectedvirtual

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 473 of file moveunit.cpp.

void MoveUnit::readData ( tnstream stream)
protectedvirtual
ActionResult MoveUnit::runAction ( const Context context)
protectedvirtual

Implements GameAction.

Definition at line 112 of file moveunit.cpp.

References Context::actingPlayer, SoundLoopManager::activate(), UnitFieldRegistration::AddView, beeline(), MapField::building, tfight::calc(), calcMoveMalus(), cconnection_areaentered_anyunit, cconnection_areaentered_specificunit, cgp_initialMapVisibility, ActionRegistry::ChangeUnitMovement, ActionRegistry::ChangeUnitProperty, ActionRegistry::ChangeView, treactionfire::checkfield(), chfliegend, chhochfliegend, chtieffliegend, Vehicle::connection, MapField::connection, SoundList::conquer_building, ActionRegistry::ConsumeResource, ActionRegistry::ConvertContainer, tfight::tavalues::damage, ContainerBaseType::DetectsMineralResources, Player::diplomacy, ChangeUnitProperty::Direction, ActionRegistry::DiscoverResources, Context::display, MapDisplayInterface::displayMap(), MapDisplayInterface::displayMovingUnit(), tfight::dv, evaluateviewcalculation(), evaluatevisibilityfield(), GameAction::execute(), SoundLoopManager::fadeOut(), fieldCrossed, fieldvisiblenow(), treactionfire::finalCheck(), VehicleType::fuelConsumption, MapField::getContainer(), getdirection(), GameMap::getField(), getFirstBit(), GameMap::getgameparameter(), SoundList::getInstance(), GameAction::getMap(), Vehicle::getMovement(), getNeighbouringFieldCoordinate(), ContainerBase::getOwner(), GameMap::getPlayer(), GameMap::getPlayerCount(), Player::getPosition(), Vehicle::getPosition(), UnitAction::getUnit(), GameMap::getUnit(), MapDisplayInterface::getUnitMovementDuration(), ContainerBaseType::hasFunction(), ChangeUnitProperty::Height, ContainerBaseType::height, Vehicle::height, treactionfire::init(), CGameOptions::Instance(), DiplomaticStateVector::isHostile(), Vehicle::isViewing(), maxmalq, Vehicle::maxMovement(), MapField::mineattacks(), MapField::mineowner(), move(), VehicleType::movemalustyp, VehicleType::movement, VehicleType::movementSoundLabel, SoundList::moving, Vehicle::networkid, ChangeUnitMovement::NONE, ChangeUnitMovement::NORMAL, SoundList::playSound(), printTimer(), UnitFieldRegistration::RegisterOnField, UnitFieldRegistration::RemoveView, MapDisplayInterface::resetMovement(), MapField::secondvehicle, Vehicle::setAttacked(), Vehicle::setnewposition(), MapCoordinate3D::setnum(), tmineattacksunit::setresult(), MapDisplayInterface::showBattle(), Vehicle::spawnMoveObjects(), ActionResult::successful(), Vehicle::typ, ActionRegistry::UnitFieldRegistration, UnitFieldRegistration::UnregisterOnField, updateFieldInfo, MapField::vehicle, Context::viewingPlayer, MapField::visible, MapCoordinate::x, and MapCoordinate::y.

ActionResult MoveUnit::undoAction ( const Context context)
protectedvirtual

Implements GameAction.

Definition at line 465 of file moveunit.cpp.

References UnitAction::getUnit(), and Vehicle::setMovement().

void MoveUnit::writeData ( tnstream stream) const
protectedvirtual

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: