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

#include <GridNotifiers.h>

Public Member Functions

 NearestAssistCreatureInCreatureRangeCheck (Creature *obj, Unit *enemy, float range)
 
bool operator() (Creature *u)
 
float GetLastRange () const
 

Private Member Functions

 NearestAssistCreatureInCreatureRangeCheck (NearestAssistCreatureInCreatureRangeCheck const &)
 

Private Attributes

Creature *const i_obj
 
Unit *const i_enemy
 
float i_range
 

Constructor & Destructor Documentation

Trinity::NearestAssistCreatureInCreatureRangeCheck::NearestAssistCreatureInCreatureRangeCheck ( Creature obj,
Unit enemy,
float  range 
)
inline
1133  : i_obj(obj), i_enemy(enemy), i_range(range) { }
Creature *const i_obj
Definition: GridNotifiers.h:1153
float i_range
Definition: GridNotifiers.h:1155
Unit *const i_enemy
Definition: GridNotifiers.h:1154
Trinity::NearestAssistCreatureInCreatureRangeCheck::NearestAssistCreatureInCreatureRangeCheck ( NearestAssistCreatureInCreatureRangeCheck const )
private

Member Function Documentation

float Trinity::NearestAssistCreatureInCreatureRangeCheck::GetLastRange ( ) const
inline
1151 { return i_range; }
float i_range
Definition: GridNotifiers.h:1155
bool Trinity::NearestAssistCreatureInCreatureRangeCheck::operator() ( Creature u)
inline
1136  {
1137  if (u == i_obj)
1138  return false;
1139  if (!u->CanAssistTo(i_obj, i_enemy))
1140  return false;
1141 
1142  if (!i_obj->IsWithinDistInMap(u, i_range))
1143  return false;
1144 
1145  if (!i_obj->IsWithinLOSInMap(u))
1146  return false;
1147 
1148  i_range = i_obj->GetDistance(u); // use found unit range as new range limit for next check
1149  return true;
1150  }
Creature *const i_obj
Definition: GridNotifiers.h:1153
bool IsWithinLOSInMap(WorldObject const *obj) const
Definition: Object.cpp:1584
float i_range
Definition: GridNotifiers.h:1155
bool CanAssistTo(const Unit *u, const Unit *enemy, bool checkfaction=true) const
Definition: Creature.cpp:2078
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition: Object.cpp:1663
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1594
Unit *const i_enemy
Definition: GridNotifiers.h:1154

+ Here is the call graph for this function:

Member Data Documentation

Unit* const Trinity::NearestAssistCreatureInCreatureRangeCheck::i_enemy
private
Creature* const Trinity::NearestAssistCreatureInCreatureRangeCheck::i_obj
private
float Trinity::NearestAssistCreatureInCreatureRangeCheck::i_range
private

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