![]() |
TrinityCore
|
#include <MotionMaster.h>
Classes | |
| class | DelayedAction |
Public Types | |
| typedef std::function< void()> | DelayedActionDefine |
| typedef std::function< bool()> | DelayedActionValidator |
Private Types | |
| typedef std::unique_ptr< MovementGenerator, MovementGeneratorDeleter > | MovementGeneratorPointer |
| typedef std::multiset< MovementGenerator *, MovementGeneratorComparator > | MotionMasterContainer |
| 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 |
Definition at line 97 of file MotionMaster.h.
| typedef std::function<void()> MotionMaster::DelayedActionDefine |
Definition at line 100 of file MotionMaster.h.
| typedef std::function<bool()> MotionMaster::DelayedActionValidator |
Definition at line 101 of file MotionMaster.h.
|
private |
Definition at line 248 of file MotionMaster.h.
|
private |
Definition at line 249 of file MotionMaster.h.
|
private |
Definition at line 247 of file MotionMaster.h.
|
explicit |
Definition at line 84 of file MotionMaster.cpp.
| MotionMaster::~MotionMaster | ( | ) |
| void MotionMaster::Add | ( | MovementGenerator * | movement, |
| MovementSlot | slot = MOTION_SLOT_ACTIVE |
||
| ) |
Definition at line 328 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1374 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprivate |
| void MotionMaster::AddToWorld | ( | ) |
| void MotionMaster::Clear | ( | ) |
Definition at line 430 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void MotionMaster::Clear | ( | MovementGeneratorMode | mode | ) |
| void MotionMaster::Clear | ( | MovementGeneratorPriority | priority | ) |
| void MotionMaster::Clear | ( | MovementSlot | slot | ) |
|
private |
Definition at line 1383 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1393 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1354 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1364 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1280 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1241 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
|
private |
Definition at line 1255 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 1232 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| bool MotionMaster::Empty | ( | ) | const |
| MovementGenerator * MotionMaster::GetCurrentMovementGenerator | ( | ) | const |
| MovementGenerator * MotionMaster::GetCurrentMovementGenerator | ( | MovementSlot | slot | ) | const |
| MovementGeneratorType MotionMaster::GetCurrentMovementGeneratorType | ( | ) | const |
Definition at line 197 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| MovementGeneratorType MotionMaster::GetCurrentMovementGeneratorType | ( | MovementSlot | slot | ) | const |
| MovementSlot MotionMaster::GetCurrentSlot | ( | ) | const |
Definition at line 175 of file MotionMaster.cpp.
| bool MotionMaster::GetDestination | ( | float & | x, |
| float & | y, | ||
| float & | z | ||
| ) |
| MovementGenerator * MotionMaster::GetMovementGenerator | ( | std::function< bool(MovementGenerator const *)> const & | filter, |
| MovementSlot | slot = MOTION_SLOT_ACTIVE |
||
| ) | const |
Definition at line 237 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| std::vector< MovementGeneratorInformation > MotionMaster::GetMovementGeneratorsInformation | ( | ) | const |
Definition at line 141 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprivate |
| bool MotionMaster::HasMovementGenerator | ( | std::function< bool(MovementGenerator const *)> const & | filter, |
| MovementSlot | slot = MOTION_SLOT_ACTIVE |
||
| ) | const |
Definition at line 264 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void MotionMaster::Initialize | ( | ) |
Definition at line 94 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void MotionMaster::InitializeDefault | ( | ) |
Definition at line 112 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void MotionMaster::LaunchMoveSpline | ( | std::function< void(Movement::MoveSplineInit &init)> && | initializer, |
| uint32 | id = 0, |
||
| MovementGeneratorPriority | priority = MOTION_PRIORITY_NORMAL, |
||
| MovementGeneratorType | type = EFFECT_MOTION_TYPE, |
||
| Scripting::v2::ActionResultSetter< MovementStopReason > && | scriptResult = {} |
||
| ) |
Definition at line 1193 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void MotionMaster::MoveAlongSplineChain | ( | uint32 | pointId, |
| std::vector< SplineChainLink > const & | chain, | ||
| bool | walk | ||
| ) |
Definition at line 993 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| 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 774 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void MotionMaster::MoveCharge | ( | PathGenerator const & | path, |
| float | speed = SPEED_CHARGE, |
||
| Unit const * | target = nullptr, |
||
| Movement::SpellEffectExtraData const * | spellEffectExtraData = nullptr |
||
| ) |
|
inline |
Definition at line 166 of file MotionMaster.h.
Here is the call graph for this function:
Here is the caller graph for this function:| void MotionMaster::MoveChase | ( | Unit * | target, |
| Optional< ChaseRange > | dist = {}, |
||
| Optional< ChaseAngle > | angle = {} |
||
| ) |
Definition at line 622 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| 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, |
||
| Scripting::v2::ActionResultSetter< MovementStopReason > && | scriptResult = {} |
||
| ) |
Definition at line 937 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:Definition at line 682 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void MotionMaster::MoveConfused | ( | ) |
Definition at line 632 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void MotionMaster::MoveDistract | ( | uint32 | time, |
| float | orientation | ||
| ) |
Definition at line 1121 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void MotionMaster::MoveFall | ( | uint32 | id = 0, |
| Scripting::v2::ActionResultSetter< MovementStopReason > && | scriptResult = {} |
||
| ) |
Definition at line 1025 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void MotionMaster::MoveFleeing | ( | Unit * | enemy, |
| Milliseconds | time = 0ms, |
||
| Scripting::v2::ActionResultSetter< MovementStopReason > && | scriptResult = {} |
||
| ) |
Definition at line 646 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void MotionMaster::MoveFollow | ( | Unit * | target, |
| float | dist, | ||
| Optional< ChaseAngle > | angle = {}, |
||
| Optional< Milliseconds > | duration = {}, |
||
| bool | ignoreTargetWalk = false, |
||
| MovementSlot | slot = MOTION_SLOT_ACTIVE, |
||
| Scripting::v2::ActionResultSetter< MovementStopReason > && | scriptResult = {} |
||
| ) |
Definition at line 607 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void MotionMaster::MoveIdle | ( | ) |
Definition at line 567 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void MotionMaster::MoveJump | ( | uint32 | id, |
| Position const & | pos, | ||
| std::variant< std::monostate, float, Milliseconds > | speedOrTime = {}, |
||
| Optional< float > | minHeight = {}, |
||
| Optional< float > | maxHeight = {}, |
||
| MovementFacingTarget const & | facing = {}, |
||
| bool | orientationFixed = false, |
||
| bool | unlimitedSpeed = false, |
||
| Optional< float > | speedMultiplier = {}, |
||
| JumpArrivalCastArgs const * | arrivalCast = nullptr, |
||
| Movement::SpellEffectExtraData const * | spellEffectExtraData = nullptr, |
||
| Scripting::v2::ActionResultSetter< MovementStopReason > && | scriptResult = {} |
||
| ) |
Definition at line 861 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void MotionMaster::MoveKnockbackFrom | ( | Position const & | origin, |
| float | speedXY, | ||
| float | speedZ, | ||
| float | angle = M_PI, |
||
| Movement::SpellEffectExtraData const * | spellEffectExtraData = nullptr |
||
| ) |
Definition at line 808 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void MotionMaster::MoveLand | ( | uint32 | id, |
| Position const & | pos, | ||
| Optional< int32 > | tierTransitionId = {}, |
||
| Optional< float > | velocity = {}, |
||
| MovementWalkRunSpeedSelectionMode | speedSelectionMode = MovementWalkRunSpeedSelectionMode::Default, |
||
| Scripting::v2::ActionResultSetter< MovementStopReason > && | scriptResult = {} |
||
| ) |
Definition at line 705 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| 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 = {}, |
||
| Optional< bool > | exactSplinePath = {}, |
||
| bool | generatePath = true, |
||
| Optional< MovementFadeObject > | fadeObject = {}, |
||
| Scripting::v2::ActionResultSetter< MovementStopReason > && | scriptResult = {} |
||
| ) |
Definition at line 1131 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| 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 = {}, |
||
| Optional< bool > | exactSplinePath = {}, |
||
| bool | generatePath = true, |
||
| Optional< MovementFadeObject > | fadeObject = {}, |
||
| Scripting::v2::ActionResultSetter< MovementStopReason > && | scriptResult = {} |
||
| ) |
| 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 = {}, |
||
| Optional< MovementFadeObject > | fadeObject = {}, |
||
| Scripting::v2::ActionResultSetter< MovementStopReason > && | scriptResult = {} |
||
| ) |
| void MotionMaster::MovePoint | ( | uint32 | id, |
| Position const & | pos, | ||
| bool | generatePath = true, |
||
| Optional< float > | finalOrient = {}, |
||
| Optional< float > | speed = {}, |
||
| MovementWalkRunSpeedSelectionMode | speedSelectionMode = MovementWalkRunSpeedSelectionMode::Default, |
||
| Optional< float > | closeEnoughDistance = {}, |
||
| Optional< MovementFadeObject > | fadeObject = {}, |
||
| Scripting::v2::ActionResultSetter< MovementStopReason > && | scriptResult = {} |
||
| ) |
| void MotionMaster::MoveRandom | ( | float | wanderDistance = 0.0f, |
| Optional< Milliseconds > | duration = {}, |
||
| Optional< float > | speed = {}, |
||
| MovementWalkRunSpeedSelectionMode | speedSelectionMode = MovementWalkRunSpeedSelectionMode::ForceWalk, |
||
| MovementSlot | slot = MOTION_SLOT_DEFAULT, |
||
| Scripting::v2::ActionResultSetter< MovementStopReason > && | scriptResult = {} |
||
| ) |
Definition at line 596 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void MotionMaster::MoveRotate | ( | uint32 | id, |
| RotateDirection | direction, | ||
| Optional< Milliseconds > | time = {}, |
||
| Optional< float > | turnSpeed = {}, |
||
| Optional< float > | totalTurnAngle = {}, |
||
| Scripting::v2::ActionResultSetter< MovementStopReason > && | scriptResult = {} |
||
| ) |
Makes the Unit turn in place.
| id | Movement identifier, later passed to script MovementInform hooks |
| direction | Rotation direction |
| time | How long should this movement last, infinite if not set |
| turnSpeed | How fast should the unit rotate, in radians per second. Uses unit's turn speed if not set |
| totalTurnAngle | Total angle of the entire movement, infinite if not set |
| scriptResult | Awaitable script result (for internal use) |
Definition at line 1174 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void MotionMaster::MoveSeekAssistance | ( | float | x, |
| float | y, | ||
| float | z | ||
| ) |
Definition at line 1071 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void MotionMaster::MoveSeekAssistanceDistract | ( | uint32 | timer | ) |
Definition at line 1086 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void MotionMaster::MoveTakeoff | ( | uint32 | id, |
| Position const & | pos, | ||
| Optional< int32 > | tierTransitionId = {}, |
||
| Optional< float > | velocity = {}, |
||
| MovementWalkRunSpeedSelectionMode | speedSelectionMode = MovementWalkRunSpeedSelectionMode::Default, |
||
| Scripting::v2::ActionResultSetter< MovementStopReason > && | scriptResult = {} |
||
| ) |
Definition at line 712 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void MotionMaster::MoveTargetedHome | ( | ) |
Definition at line 572 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void MotionMaster::MoveTaxiFlight | ( | uint32 | path, |
| uint32 | pathnode, | ||
| Optional< float > | speed = {}, |
||
| Scripting::v2::ActionResultSetter< MovementStopReason > && | scriptResult = {} |
||
| ) |
Definition at line 1097 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void MotionMaster::MoveTierTransition | ( | uint32 | id, |
| Position const & | pos, | ||
| AnimTier | newAnimTier, | ||
| Optional< int32 > | tierTransitionId = {}, |
||
| Optional< float > | velocity = {}, |
||
| MovementWalkRunSpeedSelectionMode | speedSelectionMode = MovementWalkRunSpeedSelectionMode::Default, |
||
| Scripting::v2::ActionResultSetter< MovementStopReason > && | scriptResult = {} |
||
| ) |
Definition at line 719 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
| void MotionMaster::PropagateSpeedChange | ( | ) |
Definition at line 521 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
| void MotionMaster::Remove | ( | MovementGenerator * | movement, |
| MovementSlot | slot = MOTION_SLOT_ACTIVE |
||
| ) |
Definition at line 351 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void MotionMaster::Remove | ( | MovementGeneratorType | type, |
| MovementSlot | slot = MOTION_SLOT_ACTIVE |
||
| ) |
|
inlineprivate |
|
private |
| void MotionMaster::ResumeSplineChain | ( | SplineChainResumeInfo const & | info | ) |
Definition at line 1015 of file MotionMaster.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| uint32 MotionMaster::Size | ( | ) | const |
| bool MotionMaster::StopOnDeath | ( | ) |
| void MotionMaster::Update | ( | uint32 | diff | ) |
|
private |
Definition at line 273 of file MotionMaster.h.
|
private |
Definition at line 271 of file MotionMaster.h.
|
private |
Definition at line 274 of file MotionMaster.h.
|
private |
Definition at line 275 of file MotionMaster.h.
|
private |
Definition at line 272 of file MotionMaster.h.
|
private |
Definition at line 270 of file MotionMaster.h.