TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ChaseMovementGenerator< T > Class Template Reference

#include <TargetedMovementGenerator.h>

Public Member Functions

 ChaseMovementGenerator (Unit *target)
 
 ChaseMovementGenerator (Unit *target, float offset, float angle)
 
 ~ChaseMovementGenerator ()
 
MovementGeneratorType GetMovementGeneratorType () const override
 
void DoInitialize (T *)
 
void DoFinalize (T *)
 
void DoReset (T *)
 
void MovementInform (T *)
 
bool EnableWalking () const
 
bool _lostTarget (T *u) const
 
void _reachTarget (T *)
 
template<>
void DoInitialize (Player *owner)
 
template<>
void DoInitialize (Creature *owner)
 
template<>
void MovementInform (Creature *unit)
 
- Public Member Functions inherited from TargetedMovementGeneratorMedium< T, ChaseMovementGenerator< T > >
bool DoUpdate (T *, uint32)
 
UnitGetTarget () const
 
void unitSpeedChanged () override
 
bool IsReachable () const
 
- Public Member Functions inherited from MovementGeneratorMedium< T, ChaseMovementGenerator< T > >
void Initialize (Unit *u) override
 
void Finalize (Unit *u) override
 
void Reset (Unit *u) override
 
bool Update (Unit *u, uint32 time_diff) override
 
- Public Member Functions inherited from MovementGenerator
virtual ~MovementGenerator ()
 
virtual bool GetResetPosition (Unit *, float &, float &, float &)
 
- Public Member Functions inherited from TargetedMovementGeneratorBase
 TargetedMovementGeneratorBase (Unit *target)
 
void stopFollowing ()
 

Static Public Member Functions

static void _clearUnitStateMove (T *u)
 
static void _addUnitStateMove (T *u)
 

Additional Inherited Members

- Protected Member Functions inherited from TargetedMovementGeneratorMedium< T, ChaseMovementGenerator< T > >
 TargetedMovementGeneratorMedium (Unit *target, float offset, float angle)
 
 ~TargetedMovementGeneratorMedium ()
 
void _setTargetLocation (T *owner, bool updateDestination)
 
- Protected Attributes inherited from TargetedMovementGeneratorMedium< T, ChaseMovementGenerator< T > >
PathGeneratori_path
 
TimeTrackerSmall i_recheckDistance
 
float i_offset
 
float i_angle
 
bool i_recalculateTravel
 
bool i_targetReached
 
- Protected Attributes inherited from TargetedMovementGeneratorBase
FollowerReference i_target
 

Constructor & Destructor Documentation

template<class T >
ChaseMovementGenerator< T >::ChaseMovementGenerator ( Unit target)
inline
Definition: TargetedMovementGenerator.h:38
template<class T >
ChaseMovementGenerator< T >::ChaseMovementGenerator ( Unit target,
float  offset,
float  angle 
)
inline
Definition: TargetedMovementGenerator.h:38
template<class T >
ChaseMovementGenerator< T >::~ChaseMovementGenerator ( )
inline
74 { }

Member Function Documentation

template<class T >
static void ChaseMovementGenerator< T >::_addUnitStateMove ( T *  u)
inlinestatic
84 { u->AddUnitState(UNIT_STATE_CHASE_MOVE); }
Definition: Unit.h:575
template<class T >
static void ChaseMovementGenerator< T >::_clearUnitStateMove ( T *  u)
inlinestatic
83 { u->ClearUnitState(UNIT_STATE_CHASE_MOVE); }
Definition: Unit.h:575
template<class T >
bool ChaseMovementGenerator< T >::_lostTarget ( T *  u) const
inline
86 { return u->GetVictim() != this->GetTarget(); }
Unit * GetTarget() const
Definition: TargetedMovementGenerator.h:51

+ Here is the call graph for this function:

template<class T >
template void ChaseMovementGenerator< T >::_reachTarget ( T *  )
198 {
199  if (owner->IsWithinMeleeRange(this->i_target.getTarget()))
200  owner->Attack(this->i_target.getTarget(), true);
201 }
FollowerReference i_target
Definition: TargetedMovementGenerator.h:34
TO * getTarget() const
Definition: Reference.h:94
template<class T >
template void ChaseMovementGenerator< T >::DoFinalize ( T *  )
220 {
221  owner->ClearUnitState(UNIT_STATE_CHASE | UNIT_STATE_CHASE_MOVE);
222 }
Definition: Unit.h:575
Definition: Unit.h:555
template<class T >
void ChaseMovementGenerator< T >::DoInitialize ( T *  )
template<>
void ChaseMovementGenerator< Player >::DoInitialize ( Player owner)
205 {
206  owner->AddUnitState(UNIT_STATE_CHASE | UNIT_STATE_CHASE_MOVE);
207  _setTargetLocation(owner, true);
208 }
Definition: Unit.h:575
void _setTargetLocation(T *owner, bool updateDestination)
Definition: Unit.h:555
template<>
void ChaseMovementGenerator< Creature >::DoInitialize ( Creature owner)
212 {
213  owner->SetWalk(false);
215  _setTargetLocation(owner, true);
216 }
void AddUnitState(uint32 f)
Definition: Unit.h:1394
Definition: Unit.h:575
bool SetWalk(bool enable)
Definition: Unit.cpp:15800
void _setTargetLocation(T *owner, bool updateDestination)
Definition: Unit.h:555

+ Here is the call graph for this function:

template<class T >
template void ChaseMovementGenerator< T >::DoReset ( T *  )
226 {
227  DoInitialize(owner);
228 }
template<class T >
bool ChaseMovementGenerator< T >::EnableWalking ( ) const
inline
85 { return false;}
template<class T >
MovementGeneratorType ChaseMovementGenerator< T >::GetMovementGeneratorType ( ) const
inlineoverridevirtual

Implements MovementGenerator.

76 { return CHASE_MOTION_TYPE; }
Definition: MotionMaster.h:43
template<class T >
void ChaseMovementGenerator< T >::MovementInform ( T *  )
231 { }
template<>
void ChaseMovementGenerator< Creature >::MovementInform ( Creature unit)
235 {
236  // Pass back the GUIDLow of the target. If it is pet's owner then PetAI will handle
237  if (unit->AI())
239 }
FollowerReference i_target
Definition: TargetedMovementGenerator.h:34
CreatureAI * AI() const
Definition: Creature.h:525
ObjectGuid const & GetGUID() const
Definition: Object.h:105
Definition: MotionMaster.h:43
virtual void MovementInform(uint32, uint32)
Definition: CreatureAI.h:143
TO * getTarget() const
Definition: Reference.h:94
LowType GetCounter() const
Definition: ObjectGuid.h:221

+ Here is the call graph for this function:


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