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

#include <GridNotifiers.h>

Public Member Functions

 NearestCreatureEntryWithLiveStateInObjectRangeCheck (WorldObject const &obj, uint32 entry, bool alive, float range)
 
bool operator() (Creature *u)
 
float GetLastRange () const
 

Private Member Functions

 NearestCreatureEntryWithLiveStateInObjectRangeCheck (NearestCreatureEntryWithLiveStateInObjectRangeCheck const &)
 

Private Attributes

WorldObject consti_obj
 
uint32 i_entry
 
bool i_alive
 
float i_range
 

Constructor & Destructor Documentation

Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck::NearestCreatureEntryWithLiveStateInObjectRangeCheck ( WorldObject const obj,
uint32  entry,
bool  alive,
float  range 
)
inline
1166  : i_obj(obj), i_entry(entry), i_alive(alive), i_range(range) { }
uint32 i_entry
Definition: GridNotifiers.h:1180
WorldObject const & i_obj
Definition: GridNotifiers.h:1179
Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck::NearestCreatureEntryWithLiveStateInObjectRangeCheck ( NearestCreatureEntryWithLiveStateInObjectRangeCheck const )
private

Member Function Documentation

float Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck::GetLastRange ( ) const
inline
1177 { return i_range; }
bool Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck::operator() ( Creature u)
inline
1169  {
1170  if (u->GetEntry() == i_entry && u->IsAlive() == i_alive && i_obj.IsWithinDistInMap(u, i_range))
1171  {
1172  i_range = i_obj.GetDistance(u); // use found unit range as new range limit for next check
1173  return true;
1174  }
1175  return false;
1176  }
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
bool IsAlive() const
Definition: Unit.h:1692
uint32 i_entry
Definition: GridNotifiers.h:1180
WorldObject const & i_obj
Definition: GridNotifiers.h:1179
uint32 GetEntry() const
Definition: Object.h:107

+ Here is the call graph for this function:

Member Data Documentation

bool Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck::i_alive
private
uint32 Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck::i_entry
private
WorldObject const& Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck::i_obj
private
float Trinity::NearestCreatureEntryWithLiveStateInObjectRangeCheck::i_range
private

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