TrinityCore
Loading...
Searching...
No Matches
WaypointMovementGenerator< T > Class Template Reference

#include <WaypointMovementGenerator.h>

+ Inheritance diagram for WaypointMovementGenerator< T >:

Public Member Functions

 WaypointMovementGenerator (uint32 pathId, bool repeating, Optional< Milliseconds > duration={}, Optional< float > speed={}, MovementWalkRunSpeedSelectionMode speedSelectionMode=MovementWalkRunSpeedSelectionMode::Default, Optional< std::pair< Milliseconds, Milliseconds > > waitTimeRangeAtPathEnd={}, Optional< float > wanderDistanceAtPathEnds={}, Optional< bool > followPathBackwardsFromEndToStart={}, Optional< bool > exactSplinePath={}, bool generatePath=true, Optional< MovementFadeObject > fadeObject={}, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
 
 WaypointMovementGenerator (WaypointPath const &path, bool repeating, Optional< Milliseconds > duration, Optional< float > speed, MovementWalkRunSpeedSelectionMode speedSelectionMode, Optional< std::pair< Milliseconds, Milliseconds > > waitTimeRangeAtPathEnd, Optional< float > wanderDistanceAtPathEnds, Optional< bool > followPathBackwardsFromEndToStart, Optional< bool > exactSplinePath, bool generatePath, Optional< MovementFadeObject > fadeObject, Scripting::v2::ActionResultSetter< MovementStopReason > &&scriptResult={})
 
 ~WaypointMovementGenerator ()
 
MovementGeneratorType GetMovementGeneratorType () const override
 
void UnitSpeedChanged () override
 
void Pause (uint32 timer) override
 
void Resume (uint32 overrideTimer) override
 
bool GetResetPosition (Unit *, float &x, float &y, float &z) override
 
void DoInitialize (T *owner)
 
void DoReset (T *owner)
 
bool DoUpdate (T *owner, uint32 diff)
 
void DoDeactivate (T *owner)
 
void DoFinalize (T *owner, bool active, bool movementInform)
 
WaypointPath const * GetPath () const
 
std::string GetDebugInfo () const override
 
- Public Member Functions inherited from MovementGeneratorMedium< T, WaypointMovementGenerator< T > >
void Initialize (Unit *owner) override
 
void Reset (Unit *owner) override
 
bool Update (Unit *owner, uint32 diff) override
 
void Deactivate (Unit *owner) override
 
void Finalize (Unit *owner, bool active, bool movementInform) override
 
- Public Member Functions inherited from MovementGenerator
 MovementGenerator ()
 
 MovementGenerator (MovementGenerator const &)=delete
 
 MovementGenerator (MovementGenerator &&)=delete
 
MovementGeneratoroperator= (MovementGenerator const &)=delete
 
MovementGeneratoroperator= (MovementGenerator &&)=delete
 
virtual ~MovementGenerator ()
 
void AddFlag (uint16 const flag)
 
bool HasFlag (uint16 const flag) const
 
void RemoveFlag (uint16 const flag)
 
- Public Member Functions inherited from PathMovementBase< BasePath >
 PathMovementBase ()
 
 PathMovementBase (PathType &&path)
 
virtual ~PathMovementBase ()=default
 
uint32 GetCurrentNode () const
 

Private Member Functions

void MovementInform (T const *owner) const
 
void OnArrived (T *owner)
 
void StartMove (T *owner, bool relaunch=false)
 
bool ComputeNextNode ()
 
bool UpdateMoveTimer (uint32 diff)
 
bool UpdateWaitTimer (uint32 diff)
 
bool IsFollowingPathBackwardsFromEndToStart () const
 
bool IsExactSplinePath () const
 
bool IsCyclic () const
 
bool IsLoadedFromDB () const
 
void MovementInform (Creature const *owner) const
 

Static Private Member Functions

static bool UpdateTimer (TimeTracker &timer, uint32 diff)
 

Private Attributes

Optional< TimeTracker_duration
 
Optional< float > _speed
 
MovementWalkRunSpeedSelectionMode _speedSelectionMode
 
Optional< std::pair< Milliseconds, Milliseconds > > _waitTimeRangeAtPathEnd
 
Optional< float > _wanderDistanceAtPathEnds
 
Optional< bool > _followPathBackwardsFromEndToStart
 
Optional< bool > _exactSplinePath
 
bool _repeating
 
bool _generatePath
 
Optional< MovementFadeObject_fadeObject
 
TimeTracker _moveTimer
 
TimeTracker _nextMoveTime
 
std::vector< int32_waypointTransitionSplinePoints
 
uint32 _waypointTransitionSplinePointsIndex
 
bool _isReturningToStart
 

Additional Inherited Members

- Public Types inherited from PathMovementBase< BasePath >
using PathType = BasePath
 
- Public Attributes inherited from MovementGenerator
uint8 Mode
 
uint8 Priority
 
uint16 Flags
 
uint32 BaseUnitState
 
Scripting::v2::ActionResultSetter< MovementStopReasonScriptResult
 
- Protected Member Functions inherited from MovementGenerator
void SetScriptResult (MovementStopReason reason)
 
- Protected Attributes inherited from PathMovementBase< BasePath >
PathType _path
 
uint32 _currentNode
 

Detailed Description

template<typename T>
class WaypointMovementGenerator< T >

Definition at line 30 of file WaypointMovementGenerator.h.

Constructor & Destructor Documentation

◆ WaypointMovementGenerator() [1/2]

template<typename T >
WaypointMovementGenerator< T >::WaypointMovementGenerator ( uint32  pathId,
bool  repeating,
Optional< Milliseconds duration = {},
Optional< float >  speed = {},
MovementWalkRunSpeedSelectionMode  speedSelectionMode = MovementWalkRunSpeedSelectionMode::Default,
Optional< std::pair< Milliseconds, Milliseconds > >  waitTimeRangeAtPathEnd = {},
Optional< float >  wanderDistanceAtPathEnds = {},
Optional< bool >  followPathBackwardsFromEndToStart = {},
Optional< bool >  exactSplinePath = {},
bool  generatePath = true,
Optional< MovementFadeObject fadeObject = {},
Scripting::v2::ActionResultSetter< MovementStopReason > &&  scriptResult = {} 
)
explicit

Definition at line 39 of file WaypointMovementGenerator.cpp.

◆ WaypointMovementGenerator() [2/2]

template<typename T >
WaypointMovementGenerator< T >::WaypointMovementGenerator ( WaypointPath const &  path,
bool  repeating,
Optional< Milliseconds duration,
Optional< float >  speed,
MovementWalkRunSpeedSelectionMode  speedSelectionMode,
Optional< std::pair< Milliseconds, Milliseconds > >  waitTimeRangeAtPathEnd,
Optional< float >  wanderDistanceAtPathEnds,
Optional< bool >  followPathBackwardsFromEndToStart,
Optional< bool >  exactSplinePath,
bool  generatePath,
Optional< MovementFadeObject fadeObject,
Scripting::v2::ActionResultSetter< MovementStopReason > &&  scriptResult = {} 
)
explicit

Definition at line 59 of file WaypointMovementGenerator.cpp.

◆ ~WaypointMovementGenerator()

template<typename T >
WaypointMovementGenerator< T >::~WaypointMovementGenerator ( )
default

Member Function Documentation

◆ ComputeNextNode()

template<typename T >
bool WaypointMovementGenerator< T >::ComputeNextNode ( )
private

Definition at line 677 of file WaypointMovementGenerator.cpp.

◆ DoDeactivate()

template<typename T >
void WaypointMovementGenerator< T >::DoDeactivate ( T *  owner)

Definition at line 290 of file WaypointMovementGenerator.cpp.

◆ DoFinalize()

template<typename T >
void WaypointMovementGenerator< T >::DoFinalize ( T *  owner,
bool  active,
bool  movementInform 
)

Definition at line 297 of file WaypointMovementGenerator.cpp.

◆ DoInitialize()

template<typename T >
void WaypointMovementGenerator< T >::DoInitialize ( T *  owner)

Definition at line 140 of file WaypointMovementGenerator.cpp.

◆ DoReset()

template<typename T >
void WaypointMovementGenerator< T >::DoReset ( T *  owner)

Definition at line 160 of file WaypointMovementGenerator.cpp.

◆ DoUpdate()

template<typename T >
bool WaypointMovementGenerator< T >::DoUpdate ( T *  owner,
uint32  diff 
)

Definition at line 171 of file WaypointMovementGenerator.cpp.

◆ GetDebugInfo()

template<typename T >
std::string WaypointMovementGenerator< T >::GetDebugInfo ( ) const
overridevirtual

Reimplemented from MovementGenerator.

Definition at line 736 of file WaypointMovementGenerator.cpp.

+ Here is the call graph for this function:

◆ GetMovementGeneratorType()

template<typename T >
MovementGeneratorType WaypointMovementGenerator< T >::GetMovementGeneratorType ( ) const
overridevirtual

Implements MovementGenerator.

Definition at line 84 of file WaypointMovementGenerator.cpp.

◆ GetPath()

template<typename T >
WaypointPath const * WaypointMovementGenerator< T >::GetPath ( ) const
inline

Definition at line 61 of file WaypointMovementGenerator.h.

◆ GetResetPosition()

template<typename T >
bool WaypointMovementGenerator< T >::GetResetPosition ( Unit ,
float &  x,
float &  y,
float &  z 
)
overridevirtual

Reimplemented from MovementGenerator.

Definition at line 123 of file WaypointMovementGenerator.cpp.

◆ IsCyclic()

template<typename T >
bool WaypointMovementGenerator< T >::IsCyclic ( ) const
private

Definition at line 727 of file WaypointMovementGenerator.cpp.

◆ IsExactSplinePath()

template<typename T >
bool WaypointMovementGenerator< T >::IsExactSplinePath ( ) const
private

Definition at line 718 of file WaypointMovementGenerator.cpp.

◆ IsFollowingPathBackwardsFromEndToStart()

template<typename T >
bool WaypointMovementGenerator< T >::IsFollowingPathBackwardsFromEndToStart ( ) const
private

Definition at line 709 of file WaypointMovementGenerator.cpp.

◆ IsLoadedFromDB()

template<typename T >
bool WaypointMovementGenerator< T >::IsLoadedFromDB ( ) const
inlineprivate

Definition at line 87 of file WaypointMovementGenerator.h.

◆ MovementInform() [1/2]

void WaypointMovementGenerator< Creature >::MovementInform ( Creature const *  owner) const
private

Definition at line 319 of file WaypointMovementGenerator.cpp.

+ Here is the call graph for this function:

◆ MovementInform() [2/2]

template<typename T >
void WaypointMovementGenerator< T >::MovementInform ( T const *  owner) const
private

Definition at line 314 of file WaypointMovementGenerator.cpp.

◆ OnArrived()

template<typename T >
void WaypointMovementGenerator< T >::OnArrived ( T *  owner)
private

Definition at line 331 of file WaypointMovementGenerator.cpp.

+ Here is the call graph for this function:

◆ Pause()

template<typename T >
void WaypointMovementGenerator< T >::Pause ( uint32  timer)
overridevirtual

Reimplemented from MovementGenerator.

Definition at line 90 of file WaypointMovementGenerator.cpp.

◆ Resume()

template<typename T >
void WaypointMovementGenerator< T >::Resume ( uint32  overrideTimer)
overridevirtual

Reimplemented from MovementGenerator.

Definition at line 111 of file WaypointMovementGenerator.cpp.

◆ StartMove()

template<typename T >
void WaypointMovementGenerator< T >::StartMove ( T *  owner,
bool  relaunch = false 
)
private

If creature is on transport, we assume waypoints set in DB are already transport offsets

Definition at line 467 of file WaypointMovementGenerator.cpp.

+ Here is the call graph for this function:

◆ UnitSpeedChanged()

template<typename T >
void WaypointMovementGenerator< T >::UnitSpeedChanged ( )
inlineoverridevirtual

Reimplemented from MovementGenerator.

Definition at line 50 of file WaypointMovementGenerator.h.

+ Here is the call graph for this function:

◆ UpdateMoveTimer()

template<typename T >
bool WaypointMovementGenerator< T >::UpdateMoveTimer ( uint32  diff)
inlineprivate

Definition at line 70 of file WaypointMovementGenerator.h.

+ Here is the call graph for this function:

◆ UpdateTimer()

template<typename T >
static bool WaypointMovementGenerator< T >::UpdateTimer ( TimeTracker timer,
uint32  diff 
)
inlinestaticprivate

Definition at line 72 of file WaypointMovementGenerator.h.

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

◆ UpdateWaitTimer()

template<typename T >
bool WaypointMovementGenerator< T >::UpdateWaitTimer ( uint32  diff)
inlineprivate

Definition at line 71 of file WaypointMovementGenerator.h.

+ Here is the call graph for this function:

Member Data Documentation

◆ _duration

template<typename T >
Optional<TimeTracker> WaypointMovementGenerator< T >::_duration
private

Definition at line 89 of file WaypointMovementGenerator.h.

◆ _exactSplinePath

template<typename T >
Optional<bool> WaypointMovementGenerator< T >::_exactSplinePath
private

Definition at line 95 of file WaypointMovementGenerator.h.

◆ _fadeObject

template<typename T >
Optional<MovementFadeObject> WaypointMovementGenerator< T >::_fadeObject
private

Definition at line 98 of file WaypointMovementGenerator.h.

◆ _followPathBackwardsFromEndToStart

template<typename T >
Optional<bool> WaypointMovementGenerator< T >::_followPathBackwardsFromEndToStart
private

Definition at line 94 of file WaypointMovementGenerator.h.

◆ _generatePath

template<typename T >
bool WaypointMovementGenerator< T >::_generatePath
private

Definition at line 97 of file WaypointMovementGenerator.h.

◆ _isReturningToStart

template<typename T >
bool WaypointMovementGenerator< T >::_isReturningToStart
private

Definition at line 104 of file WaypointMovementGenerator.h.

◆ _moveTimer

template<typename T >
TimeTracker WaypointMovementGenerator< T >::_moveTimer
private

Definition at line 100 of file WaypointMovementGenerator.h.

◆ _nextMoveTime

template<typename T >
TimeTracker WaypointMovementGenerator< T >::_nextMoveTime
private

Definition at line 101 of file WaypointMovementGenerator.h.

◆ _repeating

template<typename T >
bool WaypointMovementGenerator< T >::_repeating
private

Definition at line 96 of file WaypointMovementGenerator.h.

◆ _speed

template<typename T >
Optional<float> WaypointMovementGenerator< T >::_speed
private

Definition at line 90 of file WaypointMovementGenerator.h.

◆ _speedSelectionMode

template<typename T >
MovementWalkRunSpeedSelectionMode WaypointMovementGenerator< T >::_speedSelectionMode
private

Definition at line 91 of file WaypointMovementGenerator.h.

◆ _waitTimeRangeAtPathEnd

template<typename T >
Optional<std::pair<Milliseconds, Milliseconds> > WaypointMovementGenerator< T >::_waitTimeRangeAtPathEnd
private

Definition at line 92 of file WaypointMovementGenerator.h.

◆ _wanderDistanceAtPathEnds

template<typename T >
Optional<float> WaypointMovementGenerator< T >::_wanderDistanceAtPathEnds
private

Definition at line 93 of file WaypointMovementGenerator.h.

◆ _waypointTransitionSplinePoints

template<typename T >
std::vector<int32> WaypointMovementGenerator< T >::_waypointTransitionSplinePoints
private

Definition at line 102 of file WaypointMovementGenerator.h.

◆ _waypointTransitionSplinePointsIndex

template<typename T >
uint32 WaypointMovementGenerator< T >::_waypointTransitionSplinePointsIndex
private

Definition at line 103 of file WaypointMovementGenerator.h.


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