TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Trinity::NearestHostileUnitInAggroRangeCheck Class Reference

#include <GridNotifiers.h>

Public Member Functions

 NearestHostileUnitInAggroRangeCheck (Creature const *creature, bool useLOS=false)
 
bool operator() (Unit *u)
 

Private Member Functions

 NearestHostileUnitInAggroRangeCheck (NearestHostileUnitInAggroRangeCheck const &)
 

Private Attributes

Creature const_me
 
bool _useLOS
 

Constructor & Destructor Documentation

Trinity::NearestHostileUnitInAggroRangeCheck::NearestHostileUnitInAggroRangeCheck ( Creature const creature,
bool  useLOS = false 
)
inlineexplicit
1072  : _me(creature), _useLOS(useLOS)
1073  {
1074  }
Creature const * _me
Definition: GridNotifiers.h:1093
bool _useLOS
Definition: GridNotifiers.h:1094
Trinity::NearestHostileUnitInAggroRangeCheck::NearestHostileUnitInAggroRangeCheck ( NearestHostileUnitInAggroRangeCheck const )
private

Member Function Documentation

bool Trinity::NearestHostileUnitInAggroRangeCheck::operator() ( Unit u)
inline
1076  {
1077  if (!u->IsHostileTo(_me))
1078  return false;
1079 
1080  if (!u->IsWithinDistInMap(_me, _me->GetAggroRange(u)))
1081  return false;
1082 
1083  if (!_me->IsValidAttackTarget(u))
1084  return false;
1085 
1086  if (_useLOS && !u->IsWithinLOSInMap(_me))
1087  return false;
1088 
1089  return true;
1090  }
bool IsWithinLOSInMap(WorldObject const *obj) const
Definition: Object.cpp:1584
bool IsValidAttackTarget(Unit const *target) const
Definition: Unit.cpp:10002
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition: Object.cpp:1663
float GetAggroRange(Unit const *target) const
Definition: Creature.cpp:2557
Creature const * _me
Definition: GridNotifiers.h:1093
bool _useLOS
Definition: GridNotifiers.h:1094
bool IsHostileTo(Unit const *unit) const
Definition: Unit.cpp:7165

+ Here is the call graph for this function:

Member Data Documentation

Creature const* Trinity::NearestHostileUnitInAggroRangeCheck::_me
private
bool Trinity::NearestHostileUnitInAggroRangeCheck::_useLOS
private

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