TrinityCore
MotionMaster Class Reference

#include <MotionMaster.h>

Classes

class  DelayedAction
 

Public Types

typedef std::function< void()> DelayedActionDefine
 
typedef std::function< bool()> DelayedActionValidator
 

Public Member Functions

 MotionMaster (Unit *unit)
 
 ~MotionMaster ()
 
void Initialize ()
 
void InitializeDefault ()
 
void AddToWorld ()
 
bool Empty () const
 
uint32 Size () const
 
std::vector< MovementGeneratorInformationGetMovementGeneratorsInformation () const
 
MovementSlot GetCurrentSlot () const
 
MovementGeneratorGetCurrentMovementGenerator () const
 
MovementGeneratorType GetCurrentMovementGeneratorType () const
 
MovementGeneratorType GetCurrentMovementGeneratorType (MovementSlot slot) const
 
MovementGeneratorGetCurrentMovementGenerator (MovementSlot slot) const
 
MovementGeneratorGetMovementGenerator (std::function< bool(MovementGenerator const *)> const &filter, MovementSlot slot=MOTION_SLOT_ACTIVE) const
 
bool HasMovementGenerator (std::function< bool(MovementGenerator const *)> const &filter, MovementSlot slot=MOTION_SLOT_ACTIVE) const
 
void Update (uint32 diff)
 
void Add (MovementGenerator *movement, MovementSlot slot=MOTION_SLOT_ACTIVE)
 
void Remove (MovementGenerator *movement, MovementSlot slot=MOTION_SLOT_ACTIVE)
 
void Remove (MovementGeneratorType type, MovementSlot slot=MOTION_SLOT_ACTIVE)
 
void Clear ()
 
void Clear (MovementSlot slot)
 
void Clear (MovementGeneratorMode mode)
 
void Clear (MovementGeneratorPriority priority)
 
void PropagateSpeedChange ()
 
bool GetDestination (float &x, float &y, float &z)
 
bool StopOnDeath ()
 
void MoveIdle ()
 
void MoveTargetedHome ()
 
void MoveRandom (float wanderDistance=0.0f, Optional< Milliseconds > duration={}, MovementSlot slot=MOTION_SLOT_DEFAULT)
 
void MoveFollow (Unit *target, float dist, ChaseAngle angle, Optional< Milliseconds > duration={}, MovementSlot slot=MOTION_SLOT_ACTIVE)
 
void MoveChase (Unit *target, Optional< ChaseRange > dist={}, Optional< ChaseAngle > angle={})
 
void MoveChase (Unit *target, float dist, float angle)
 
void MoveConfused ()
 
void MoveFleeing (Unit *enemy, Milliseconds time=0ms)
 
void MovePoint (uint32 id, Position const &pos, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={})
 
void MovePoint (uint32 id, float x, float y, float z, bool generatePath=true, Optional< float > finalOrient={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< float > closeEnoughDistance={})
 
void MoveCloserAndStop (uint32 id, Unit *target, float distance)
 
void MoveLand (uint32 id, Position const &pos, Optional< int32 > tierTransitionId={}, Optional< float > velocity={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default)
 
void MoveTakeoff (uint32 id, Position const &pos, Optional< int32 > tierTransitionId={}, Optional< float > velocity={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default)
 
void MoveCharge (float x, float y, float z, float speed=SPEED_CHARGE, uint32 id=EVENT_CHARGE, bool generatePath=false, Unit const *target=nullptr, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr)
 
void MoveCharge (PathGenerator const &path, float speed=SPEED_CHARGE, Unit const *target=nullptr, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr)
 
void MoveKnockbackFrom (Position const &origin, float speedXY, float speedZ, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr)
 
void MoveJumpTo (float angle, float speedXY, float speedZ)
 
void MoveJump (Position const &pos, float speedXY, float speedZ, uint32 id=EVENT_JUMP, bool hasOrientation=false, JumpArrivalCastArgs const *arrivalCast=nullptr, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr)
 
void MoveJump (float x, float y, float z, float o, float speedXY, float speedZ, uint32 id=EVENT_JUMP, bool hasOrientation=false, JumpArrivalCastArgs const *arrivalCast=nullptr, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr)
 
void MoveJumpWithGravity (Position const &pos, float speedXY, float gravity, uint32 id=EVENT_JUMP, bool hasOrientation=false, JumpArrivalCastArgs const *arrivalCast=nullptr, Movement::SpellEffectExtraData const *spellEffectExtraData=nullptr)
 
void MoveCirclePath (float x, float y, float z, float radius, bool clockwise, uint8 stepCount, Optional< Milliseconds > duration={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default)
 
void MoveSmoothPath (uint32 pointId, Position const *pathPoints, size_t pathSize, bool walk=false, bool fly=false)
 
void MoveAlongSplineChain (uint32 pointId, uint16 dbChainId, bool walk)
 
void MoveAlongSplineChain (uint32 pointId, std::vector< SplineChainLink > const &chain, bool walk)
 
void ResumeSplineChain (SplineChainResumeInfo const &info)
 
void MoveFall (uint32 id=0)
 
void MoveSeekAssistance (float x, float y, float z)
 
void MoveSeekAssistanceDistract (uint32 timer)
 
void MoveTaxiFlight (uint32 path, uint32 pathnode)
 
void MoveDistract (uint32 time, float orientation)
 
void MovePath (uint32 pathId, bool repeatable, Optional< Milliseconds > duration={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< std::pair< Milliseconds, Milliseconds > > waitTimeRangeAtPathEnd={}, Optional< float > wanderDistanceAtPathEnds={}, Optional< bool > followPathBackwardsFromEndToStart={}, bool generatePath=true)
 
void MovePath (WaypointPath const &path, bool repeatable, Optional< Milliseconds > duration={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< std::pair< Milliseconds, Milliseconds > > waitTimeRangeAtPathEnd={}, Optional< float > wanderDistanceAtPathEnds={}, Optional< bool > followPathBackwardsFromEndToStart={}, bool generatePath=true)
 
void MoveRotate (uint32 id, RotateDirection direction, Optional< Milliseconds > time={}, Optional< float > turnSpeed={}, Optional< float > totalTurnAngle={})
 Makes the Unit turn in place. More...
 
void MoveFormation (Unit *leader, float range, float angle, uint32 point1, uint32 point2)
 
void LaunchMoveSpline (std::function< void(Movement::MoveSplineInit &init)> &&initializer, uint32 id=0, MovementGeneratorPriority priority=MOTION_PRIORITY_NORMAL, MovementGeneratorType type=EFFECT_MOTION_TYPE)
 
void CalculateJumpSpeeds (float dist, UnitMoveType moveType, float speedMultiplier, float minHeight, float maxHeight, float &speedXY, float &speedZ) const
 

Private Types

typedef std::unique_ptr< MovementGenerator, MovementGeneratorDeleterMovementGeneratorPointer
 
typedef std::multiset< MovementGenerator *, MovementGeneratorComparatorMotionMasterContainer
 
typedef std::unordered_multimap< uint32, MovementGenerator const * > MotionMasterUnitStatesContainer
 

Private Member Functions

void AddFlag (uint8 const flag)
 
bool HasFlag (uint8 const flag) const
 
void RemoveFlag (uint8 const flag)
 
void ResolveDelayedActions ()
 
void Remove (MotionMasterContainer::iterator iterator, bool active, bool movementInform)
 
void Pop (bool active, bool movementInform)
 
void DirectInitialize ()
 
void DirectClear ()
 
void DirectClearDefault ()
 
void DirectClear (std::function< bool(MovementGenerator *)> const &filter)
 
void DirectAdd (MovementGenerator *movement, MovementSlot slot)
 
void Delete (MovementGenerator *movement, bool active, bool movementInform)
 
void DeleteDefault (bool active, bool movementInform)
 
void AddBaseUnitState (MovementGenerator const *movement)
 
void ClearBaseUnitState (MovementGenerator const *movement)
 
void ClearBaseUnitStates ()
 

Private Attributes

Unit_owner
 
MovementGeneratorPointer _defaultGenerator
 
MotionMasterContainer _generators
 
MotionMasterUnitStatesContainer _baseUnitStatesMap
 
std::deque< DelayedAction_delayedActions
 
uint8 _flags
 

Detailed Description

Definition at line 96 of file MotionMaster.h.

Member Typedef Documentation

◆ DelayedActionDefine

typedef std::function<void()> MotionMaster::DelayedActionDefine

Definition at line 99 of file MotionMaster.h.

◆ DelayedActionValidator

typedef std::function<bool()> MotionMaster::DelayedActionValidator

Definition at line 100 of file MotionMaster.h.

◆ MotionMasterContainer

Definition at line 227 of file MotionMaster.h.

◆ MotionMasterUnitStatesContainer

typedef std::unordered_multimap<uint32, MovementGenerator const*> MotionMaster::MotionMasterUnitStatesContainer
private

Definition at line 228 of file MotionMaster.h.

◆ MovementGeneratorPointer

Definition at line 226 of file MotionMaster.h.

Constructor & Destructor Documentation

◆ MotionMaster()

MotionMaster::MotionMaster ( Unit unit)
explicit

Definition at line 87 of file MotionMaster.cpp.

◆ ~MotionMaster()

MotionMaster::~MotionMaster ( )

Definition at line 89 of file MotionMaster.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ Add()

void MotionMaster::Add ( MovementGenerator movement,
MovementSlot  slot = MOTION_SLOT_ACTIVE 
)

Definition at line 331 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddBaseUnitState()

void MotionMaster::AddBaseUnitState ( MovementGenerator const *  movement)
private

Definition at line 1358 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ AddFlag()

void MotionMaster::AddFlag ( uint8 const  flag)
inlineprivate

Definition at line 230 of file MotionMaster.h.

+ Here is the caller graph for this function:

◆ AddToWorld()

void MotionMaster::AddToWorld ( )

Definition at line 120 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ CalculateJumpSpeeds()

void MotionMaster::CalculateJumpSpeeds ( float  dist,
UnitMoveType  moveType,
float  speedMultiplier,
float  minHeight,
float  maxHeight,
float &  speedXY,
float &  speedZ 
) const

Definition at line 1171 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Clear() [1/4]

void MotionMaster::Clear ( )

Definition at line 433 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Clear() [2/4]

void MotionMaster::Clear ( MovementGeneratorMode  mode)

Definition at line 480 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ Clear() [3/4]

void MotionMaster::Clear ( MovementGeneratorPriority  priority)

Definition at line 502 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ Clear() [4/4]

void MotionMaster::Clear ( MovementSlot  slot)

Definition at line 449 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ ClearBaseUnitState()

void MotionMaster::ClearBaseUnitState ( MovementGenerator const *  movement)
private

Definition at line 1367 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ClearBaseUnitStates()

void MotionMaster::ClearBaseUnitStates ( )
private

Definition at line 1377 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Delete()

void MotionMaster::Delete ( MovementGenerator movement,
bool  active,
bool  movementInform 
)
private

Definition at line 1338 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DeleteDefault()

void MotionMaster::DeleteDefault ( bool  active,
bool  movementInform 
)
private

Definition at line 1348 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DirectAdd()

void MotionMaster::DirectAdd ( MovementGenerator movement,
MovementSlot  slot 
)
private

Definition at line 1264 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DirectClear() [1/2]

void MotionMaster::DirectClear ( )
private

Definition at line 1225 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DirectClear() [2/2]

void MotionMaster::DirectClear ( std::function< bool(MovementGenerator *)> const &  filter)
private

Definition at line 1245 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ DirectClearDefault()

void MotionMaster::DirectClearDefault ( )
private

Definition at line 1239 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DirectInitialize()

void MotionMaster::DirectInitialize ( )
private

Definition at line 1216 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Empty()

bool MotionMaster::Empty ( ) const

Definition at line 134 of file MotionMaster.cpp.

+ Here is the caller graph for this function:

◆ GetCurrentMovementGenerator() [1/2]

MovementGenerator * MotionMaster::GetCurrentMovementGenerator ( ) const

Definition at line 189 of file MotionMaster.cpp.

+ Here is the caller graph for this function:

◆ GetCurrentMovementGenerator() [2/2]

MovementGenerator * MotionMaster::GetCurrentMovementGenerator ( MovementSlot  slot) const

Definition at line 226 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ GetCurrentMovementGeneratorType() [1/2]

MovementGeneratorType MotionMaster::GetCurrentMovementGeneratorType ( ) const

Definition at line 200 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetCurrentMovementGeneratorType() [2/2]

MovementGeneratorType MotionMaster::GetCurrentMovementGeneratorType ( MovementSlot  slot) const

Definition at line 212 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ GetCurrentSlot()

MovementSlot MotionMaster::GetCurrentSlot ( ) const

Definition at line 178 of file MotionMaster.cpp.

◆ GetDestination()

bool MotionMaster::GetDestination ( float &  x,
float &  y,
float &  z 
)

Definition at line 536 of file MotionMaster.cpp.

+ Here is the caller graph for this function:

◆ GetMovementGenerator()

MovementGenerator * MotionMaster::GetMovementGenerator ( std::function< bool(MovementGenerator const *)> const &  filter,
MovementSlot  slot = MOTION_SLOT_ACTIVE 
) const

Definition at line 240 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetMovementGeneratorsInformation()

std::vector< MovementGeneratorInformation > MotionMaster::GetMovementGeneratorsInformation ( ) const

Definition at line 144 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasFlag()

bool MotionMaster::HasFlag ( uint8 const  flag) const
inlineprivate

Definition at line 231 of file MotionMaster.h.

+ Here is the caller graph for this function:

◆ HasMovementGenerator()

bool MotionMaster::HasMovementGenerator ( std::function< bool(MovementGenerator const *)> const &  filter,
MovementSlot  slot = MOTION_SLOT_ACTIVE 
) const

Definition at line 267 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Initialize()

void MotionMaster::Initialize ( )

Definition at line 97 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ InitializeDefault()

void MotionMaster::InitializeDefault ( )

Definition at line 115 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ LaunchMoveSpline()

void MotionMaster::LaunchMoveSpline ( std::function< void(Movement::MoveSplineInit &init)> &&  initializer,
uint32  id = 0,
MovementGeneratorPriority  priority = MOTION_PRIORITY_NORMAL,
MovementGeneratorType  type = EFFECT_MOTION_TYPE 
)

Definition at line 1156 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveAlongSplineChain() [1/2]

void MotionMaster::MoveAlongSplineChain ( uint32  pointId,
std::vector< SplineChainLink > const &  chain,
bool  walk 
)

Definition at line 1002 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ MoveAlongSplineChain() [2/2]

void MotionMaster::MoveAlongSplineChain ( uint32  pointId,
uint16  dbChainId,
bool  walk 
)

Definition at line 985 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveCharge() [1/2]

void MotionMaster::MoveCharge ( float  x,
float  y,
float  z,
float  speed = SPEED_CHARGE,
uint32  id = EVENT_CHARGE,
bool  generatePath = false,
Unit const *  target = nullptr,
Movement::SpellEffectExtraData const *  spellEffectExtraData = nullptr 
)

Definition at line 744 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveCharge() [2/2]

void MotionMaster::MoveCharge ( PathGenerator const &  path,
float  speed = SPEED_CHARGE,
Unit const *  target = nullptr,
Movement::SpellEffectExtraData const *  spellEffectExtraData = nullptr 
)

Definition at line 758 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ MoveChase() [1/2]

void MotionMaster::MoveChase ( Unit target,
float  dist,
float  angle 
)
inline

Definition at line 162 of file MotionMaster.h.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveChase() [2/2]

void MotionMaster::MoveChase ( Unit target,
Optional< ChaseRange dist = {},
Optional< ChaseAngle angle = {} 
)

Definition at line 618 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveCirclePath()

void MotionMaster::MoveCirclePath ( float  x,
float  y,
float  z,
float  radius,
bool  clockwise,
uint8  stepCount,
Optional< Milliseconds duration = {},
Optional< float >  speed = {},
MovementWalkRunSpeedSelectionMode  speedSelectionMode = MovementWalkRunSpeedSelectionMode::Default 
)

Definition at line 906 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveCloserAndStop()

void MotionMaster::MoveCloserAndStop ( uint32  id,
Unit target,
float  distance 
)

Definition at line 667 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveConfused()

void MotionMaster::MoveConfused ( )

Definition at line 628 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveDistract()

void MotionMaster::MoveDistract ( uint32  time,
float  orientation 
)

Definition at line 1105 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveFall()

void MotionMaster::MoveFall ( uint32  id = 0)

Definition at line 1017 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveFleeing()

void MotionMaster::MoveFleeing ( Unit enemy,
Milliseconds  time = 0ms 
)

Definition at line 642 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveFollow()

void MotionMaster::MoveFollow ( Unit target,
float  dist,
ChaseAngle  angle,
Optional< Milliseconds duration = {},
MovementSlot  slot = MOTION_SLOT_ACTIVE 
)

Definition at line 608 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveFormation()

void MotionMaster::MoveFormation ( Unit leader,
float  range,
float  angle,
uint32  point1,
uint32  point2 
)

Definition at line 1147 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveIdle()

void MotionMaster::MoveIdle ( )

Definition at line 570 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveJump() [1/2]

void MotionMaster::MoveJump ( float  x,
float  y,
float  z,
float  o,
float  speedXY,
float  speedZ,
uint32  id = EVENT_JUMP,
bool  hasOrientation = false,
JumpArrivalCastArgs const *  arrivalCast = nullptr,
Movement::SpellEffectExtraData const *  spellEffectExtraData = nullptr 
)

Definition at line 834 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ MoveJump() [2/2]

void MotionMaster::MoveJump ( Position const &  pos,
float  speedXY,
float  speedZ,
uint32  id = EVENT_JUMP,
bool  hasOrientation = false,
JumpArrivalCastArgs const *  arrivalCast = nullptr,
Movement::SpellEffectExtraData const *  spellEffectExtraData = nullptr 
)

Definition at line 828 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveJumpTo()

void MotionMaster::MoveJumpTo ( float  angle,
float  speedXY,
float  speedZ 
)

Definition at line 811 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveJumpWithGravity()

void MotionMaster::MoveJumpWithGravity ( Position const &  pos,
float  speedXY,
float  gravity,
uint32  id = EVENT_JUMP,
bool  hasOrientation = false,
JumpArrivalCastArgs const *  arrivalCast = nullptr,
Movement::SpellEffectExtraData const *  spellEffectExtraData = nullptr 
)

Definition at line 870 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveKnockbackFrom()

void MotionMaster::MoveKnockbackFrom ( Position const &  origin,
float  speedXY,
float  speedZ,
Movement::SpellEffectExtraData const *  spellEffectExtraData = nullptr 
)

Definition at line 778 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveLand()

void MotionMaster::MoveLand ( uint32  id,
Position const &  pos,
Optional< int32 tierTransitionId = {},
Optional< float >  velocity = {},
MovementWalkRunSpeedSelectionMode  speedSelectionMode = MovementWalkRunSpeedSelectionMode::Default 
)

Definition at line 690 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MovePath() [1/2]

void MotionMaster::MovePath ( uint32  pathId,
bool  repeatable,
Optional< Milliseconds duration = {},
Optional< float >  speed = {},
MovementWalkRunSpeedSelectionMode  speedSelectionMode = MovementWalkRunSpeedSelectionMode::Default,
Optional< std::pair< Milliseconds, Milliseconds > >  waitTimeRangeAtPathEnd = {},
Optional< float >  wanderDistanceAtPathEnds = {},
Optional< bool >  followPathBackwardsFromEndToStart = {},
bool  generatePath = true 
)

Definition at line 1115 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MovePath() [2/2]

void MotionMaster::MovePath ( WaypointPath const &  path,
bool  repeatable,
Optional< Milliseconds duration = {},
Optional< float >  speed = {},
MovementWalkRunSpeedSelectionMode  speedSelectionMode = MovementWalkRunSpeedSelectionMode::Default,
Optional< std::pair< Milliseconds, Milliseconds > >  waitTimeRangeAtPathEnd = {},
Optional< float >  wanderDistanceAtPathEnds = {},
Optional< bool >  followPathBackwardsFromEndToStart = {},
bool  generatePath = true 
)

Definition at line 1128 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ MovePoint() [1/2]

void MotionMaster::MovePoint ( uint32  id,
float  x,
float  y,
float  z,
bool  generatePath = true,
Optional< float >  finalOrient = {},
Optional< float >  speed = {},
MovementWalkRunSpeedSelectionMode  speedSelectionMode = MovementWalkRunSpeedSelectionMode::Default,
Optional< float >  closeEnoughDistance = {} 
)

Definition at line 660 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ MovePoint() [2/2]

void MotionMaster::MovePoint ( uint32  id,
Position const &  pos,
bool  generatePath = true,
Optional< float >  finalOrient = {},
Optional< float >  speed = {},
MovementWalkRunSpeedSelectionMode  speedSelectionMode = MovementWalkRunSpeedSelectionMode::Default,
Optional< float >  closeEnoughDistance = {} 
)

Definition at line 654 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ MoveRandom()

void MotionMaster::MoveRandom ( float  wanderDistance = 0.0f,
Optional< Milliseconds duration = {},
MovementSlot  slot = MOTION_SLOT_DEFAULT 
)

Definition at line 599 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveRotate()

void MotionMaster::MoveRotate ( uint32  id,
RotateDirection  direction,
Optional< Milliseconds time = {},
Optional< float >  turnSpeed = {},
Optional< float >  totalTurnAngle = {} 
)

Makes the Unit turn in place.

Parameters
idMovement identifier, later passed to script MovementInform hooks
directionRotation direction
timeHow long should this movement last, infinite if not set
turnSpeedHow fast should the unit rotate, in radians per second. Uses unit's turn speed if not set
totalTurnAngleTotal angle of the entire movement, infinite if not set

Definition at line 1138 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveSeekAssistance()

void MotionMaster::MoveSeekAssistance ( float  x,
float  y,
float  z 
)

Definition at line 1056 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveSeekAssistanceDistract()

void MotionMaster::MoveSeekAssistanceDistract ( uint32  timer)

Definition at line 1071 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveSmoothPath()

void MotionMaster::MoveSmoothPath ( uint32  pointId,
Position const *  pathPoints,
size_t  pathSize,
bool  walk = false,
bool  fly = false 
)

Definition at line 959 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveTakeoff()

void MotionMaster::MoveTakeoff ( uint32  id,
Position const &  pos,
Optional< int32 tierTransitionId = {},
Optional< float >  velocity = {},
MovementWalkRunSpeedSelectionMode  speedSelectionMode = MovementWalkRunSpeedSelectionMode::Default 
)

Definition at line 717 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveTargetedHome()

void MotionMaster::MoveTargetedHome ( )

Definition at line 575 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ MoveTaxiFlight()

void MotionMaster::MoveTaxiFlight ( uint32  path,
uint32  pathnode 
)

Definition at line 1082 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Pop()

void MotionMaster::Pop ( bool  active,
bool  movementInform 
)
private

Definition at line 1210 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ PropagateSpeedChange()

void MotionMaster::PropagateSpeedChange ( )

Definition at line 524 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Remove() [1/3]

void MotionMaster::Remove ( MotionMasterContainer::iterator  iterator,
bool  active,
bool  movementInform 
)
private

Definition at line 1203 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ Remove() [2/3]

void MotionMaster::Remove ( MovementGenerator movement,
MovementSlot  slot = MOTION_SLOT_ACTIVE 
)

Definition at line 354 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Remove() [3/3]

void MotionMaster::Remove ( MovementGeneratorType  type,
MovementSlot  slot = MOTION_SLOT_ACTIVE 
)

Definition at line 392 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ RemoveFlag()

void MotionMaster::RemoveFlag ( uint8 const  flag)
inlineprivate

Definition at line 232 of file MotionMaster.h.

+ Here is the caller graph for this function:

◆ ResolveDelayedActions()

void MotionMaster::ResolveDelayedActions ( )
private

Definition at line 1194 of file MotionMaster.cpp.

+ Here is the caller graph for this function:

◆ ResumeSplineChain()

void MotionMaster::ResumeSplineChain ( SplineChainResumeInfo const &  info)

Definition at line 1007 of file MotionMaster.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Size()

uint32 MotionMaster::Size ( ) const

Definition at line 139 of file MotionMaster.cpp.

+ Here is the caller graph for this function:

◆ StopOnDeath()

bool MotionMaster::StopOnDeath ( )

Definition at line 548 of file MotionMaster.cpp.

+ Here is the call graph for this function:

◆ Update()

void MotionMaster::Update ( uint32  diff)

Definition at line 293 of file MotionMaster.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ _baseUnitStatesMap

MotionMasterUnitStatesContainer MotionMaster::_baseUnitStatesMap
private

Definition at line 252 of file MotionMaster.h.

◆ _defaultGenerator

MovementGeneratorPointer MotionMaster::_defaultGenerator
private

Definition at line 250 of file MotionMaster.h.

◆ _delayedActions

std::deque<DelayedAction> MotionMaster::_delayedActions
private

Definition at line 253 of file MotionMaster.h.

◆ _flags

uint8 MotionMaster::_flags
private

Definition at line 254 of file MotionMaster.h.

◆ _generators

MotionMasterContainer MotionMaster::_generators
private

Definition at line 251 of file MotionMaster.h.

◆ _owner

Unit* MotionMaster::_owner
private

Definition at line 249 of file MotionMaster.h.


The documentation for this class was generated from the following files: