![]() |
TrinityCore
|
#include <RandomMovementGenerator.h>
Inheritance diagram for RandomMovementGenerator< T >:Public Member Functions | |
| RandomMovementGenerator (float distance=0.0f) | |
| MovementGeneratorType | GetMovementGeneratorType () const override |
| void | Pause (uint32 timer=0) override |
| void | Resume (uint32 overrideTimer=0) override |
| bool | DoInitialize (T *) |
| bool | DoReset (T *) |
| bool | DoUpdate (T *, uint32) |
| void | DoDeactivate (T *) |
| void | DoFinalize (T *, bool, bool) |
| void | UnitSpeedChanged () override |
| bool | DoInitialize (Creature *owner) |
| bool | DoReset (Creature *owner) |
| bool | DoUpdate (Creature *owner, uint32 diff) |
| void | DoDeactivate (Creature *owner) |
| void | DoFinalize (Creature *owner, bool active, bool) |
Public Member Functions inherited from MovementGeneratorMedium< T, RandomMovementGenerator< T > > | |
| bool | Initialize (Unit *owner) override |
| bool | 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 () | |
| virtual | ~MovementGenerator () |
| virtual bool | GetResetPosition (Unit *, float &, float &, float &) |
| void | AddFlag (uint16 const flag) |
| bool | HasFlag (uint16 const flag) const |
| void | RemoveFlag (uint16 const flag) |
| virtual std::string | GetDebugInfo () const |
Private Member Functions | |
| void | SetRandomLocation (T *) |
| void | SetRandomLocation (Creature *owner) |
Private Attributes | |
| std::unique_ptr< PathGenerator > | _path |
| TimeTracker | _timer |
| Position | _reference |
| float | _wanderDistance |
| uint8 | _wanderSteps |
Additional Inherited Members | |
Public Attributes inherited from MovementGenerator | |
| uint8 | Priority |
| uint16 | Flags |
| uint32 | BaseUnitState |
Definition at line 28 of file RandomMovementGenerator.h.
|
explicit |
Definition at line 28 of file RandomMovementGenerator.cpp.
References MovementGenerator::BaseUnitState, MovementGenerator::Flags, MOTION_PRIORITY_NORMAL, MOVEMENTGENERATOR_FLAG_INITIALIZATION_PENDING, MovementGenerator::Priority, and UNIT_STATE_ROAMING.
| void RandomMovementGenerator< Creature >::DoDeactivate | ( | Creature * | owner | ) |
Definition at line 224 of file RandomMovementGenerator.cpp.
References Unit::ClearUnitState(), MOVEMENTGENERATOR_FLAG_DEACTIVATED, and UNIT_STATE_ROAMING_MOVE.
| void RandomMovementGenerator< T >::DoDeactivate | ( | T * | ) |
Definition at line 221 of file RandomMovementGenerator.cpp.
| void RandomMovementGenerator< Creature >::DoFinalize | ( | Creature * | owner, |
| bool | active, | ||
| bool | |||
| ) |
Definition at line 234 of file RandomMovementGenerator.cpp.
References Unit::ClearUnitState(), MOVEMENTGENERATOR_FLAG_FINALIZED, Unit::SetWalk(), Unit::StopMoving(), and UNIT_STATE_ROAMING_MOVE.
| void RandomMovementGenerator< T >::DoFinalize | ( | T * | , |
| bool | , | ||
| bool | |||
| ) |
Definition at line 231 of file RandomMovementGenerator.cpp.
| bool RandomMovementGenerator< Creature >::DoInitialize | ( | Creature * | owner | ) |
Definition at line 74 of file RandomMovementGenerator.cpp.
References Position::GetPosition(), Creature::GetWanderDistance(), Unit::IsAlive(), MOVEMENTGENERATOR_FLAG_DEACTIVATED, MOVEMENTGENERATOR_FLAG_INITIALIZATION_PENDING, MOVEMENTGENERATOR_FLAG_INITIALIZED, MOVEMENTGENERATOR_FLAG_TIMED_PAUSED, MOVEMENTGENERATOR_FLAG_TRANSITORY, and urand().
| bool RandomMovementGenerator< T >::DoInitialize | ( | T * | ) |
Definition at line 71 of file RandomMovementGenerator.cpp.
| bool RandomMovementGenerator< Creature >::DoReset | ( | Creature * | owner | ) |
Definition at line 99 of file RandomMovementGenerator.cpp.
References MOVEMENTGENERATOR_FLAG_DEACTIVATED, and MOVEMENTGENERATOR_FLAG_TRANSITORY.
| bool RandomMovementGenerator< T >::DoReset | ( | T * | ) |
Definition at line 96 of file RandomMovementGenerator.cpp.
| bool RandomMovementGenerator< Creature >::DoUpdate | ( | Creature * | owner, |
| uint32 | diff | ||
| ) |
Definition at line 195 of file RandomMovementGenerator.cpp.
References Movement::MoveSpline::Finalized(), Unit::HasUnitState(), Unit::IsAlive(), Creature::IsMovementPreventedByCasting(), MOVEMENTGENERATOR_FLAG_FINALIZED, MOVEMENTGENERATOR_FLAG_INTERRUPTED, MOVEMENTGENERATOR_FLAG_PAUSED, MOVEMENTGENERATOR_FLAG_SPEED_UPDATE_PENDING, Unit::movespline, Unit::StopMoving(), and UNIT_STATE_NOT_MOVE.
| bool RandomMovementGenerator< T >::DoUpdate | ( | T * | , |
| uint32 | |||
| ) |
Definition at line 189 of file RandomMovementGenerator.cpp.
|
overridevirtual |
Implements MovementGenerator.
Definition at line 38 of file RandomMovementGenerator.cpp.
References RANDOM_MOTION_TYPE.
|
overridevirtual |
Reimplemented from MovementGenerator.
Definition at line 44 of file RandomMovementGenerator.cpp.
References MOVEMENTGENERATOR_FLAG_PAUSED, and MOVEMENTGENERATOR_FLAG_TIMED_PAUSED.
|
overridevirtual |
Reimplemented from MovementGenerator.
Definition at line 60 of file RandomMovementGenerator.cpp.
References MOVEMENTGENERATOR_FLAG_PAUSED.
|
private |
Definition at line 110 of file RandomMovementGenerator.cpp.
References Unit::AddUnitState(), AlwaysRun, CanRun, frand(), Creature::GetMovementTemplate(), Position::GetPositionX(), Position::GetPositionY(), Position::GetPositionZ(), CreatureMovementData::GetRandom(), Unit::HasUnitState(), IN_MILLISECONDS, Creature::IsMovementPreventedByCasting(), Unit::IsWalking(), WorldObject::IsWithinLOS(), Movement::MoveSplineInit::Launch(), M_PI, Movement::MoveSplineInit::MovebyPath(), MOVEMENTGENERATOR_FLAG_INTERRUPTED, MOVEMENTGENERATOR_FLAG_TIMED_PAUSED, MOVEMENTGENERATOR_FLAG_TRANSITORY, WorldObject::MovePositionToFirstCollision(), PATHFIND_NOPATH, PATHFIND_SHORTCUT, Movement::MoveSplineInit::SetWalk(), Creature::SignalFormationMovement(), Unit::StopMoving(), UNIT_STATE_LOST_CONTROL, UNIT_STATE_NOT_MOVE, UNIT_STATE_ROAMING_MOVE, and urand().
|
private |
Definition at line 107 of file RandomMovementGenerator.cpp.
|
inlineoverridevirtual |
Reimplemented from MovementGenerator.
Definition at line 44 of file RandomMovementGenerator.h.
References MovementGenerator::AddFlag(), and MOVEMENTGENERATOR_FLAG_SPEED_UPDATE_PENDING.
|
private |
Definition at line 49 of file RandomMovementGenerator.h.
|
private |
Definition at line 51 of file RandomMovementGenerator.h.
|
private |
Definition at line 50 of file RandomMovementGenerator.h.
|
private |
Definition at line 52 of file RandomMovementGenerator.h.
|
private |
Definition at line 53 of file RandomMovementGenerator.h.