AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck Class Reference

#include "GridNotifiers.h"

Public Member Functions

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

Private Member Functions

 NearestCreatureEntryWithLiveStateInObjectRangeCheck (NearestCreatureEntryWithLiveStateInObjectRangeCheck const &)
 

Private Attributes

WorldObject const & i_obj
 
uint32 i_entry
 
bool i_alive
 
float i_range
 

Detailed Description

Constructor & Destructor Documentation

◆ NearestCreatureEntryWithLiveStateInObjectRangeCheck() [1/2]

Acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck::NearestCreatureEntryWithLiveStateInObjectRangeCheck ( WorldObject const &  obj,
uint32  entry,
bool  alive,
float  range 
)
inline
1322 : i_obj(obj), i_entry(entry), i_alive(alive), i_range(range) {}
WorldObject const & i_obj
Definition GridNotifiers.h:1334
uint32 i_entry
Definition GridNotifiers.h:1335

◆ NearestCreatureEntryWithLiveStateInObjectRangeCheck() [2/2]

Acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck::NearestCreatureEntryWithLiveStateInObjectRangeCheck ( NearestCreatureEntryWithLiveStateInObjectRangeCheck const &  )
private

Member Function Documentation

◆ operator()()

bool Acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck::operator() ( Creature u)
inline
1325 {
1326 if (u->GetEntry() == i_entry && u->IsAlive() == i_alive && i_obj.IsWithinDist(u, i_range) && i_obj.InSamePhase(u))
1327 {
1328 i_range = i_obj.GetDistance(u); // use found unit range as new range limit for next check
1329 return true;
1330 }
1331 return false;
1332 }
uint32 GetEntry() const
Definition Object.h:116
bool IsAlive() const
Definition Unit.h:1707
bool IsWithinDist(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition Object.cpp:1309
bool InSamePhase(WorldObject const *obj) const
Definition Object.h:503
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:1238

References WorldObject::GetDistance(), Object::GetEntry(), i_alive, i_entry, i_obj, i_range, WorldObject::InSamePhase(), Unit::IsAlive(), and WorldObject::IsWithinDist().

Member Data Documentation

◆ i_alive

bool Acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck::i_alive
private

Referenced by operator()().

◆ i_entry

uint32 Acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck::i_entry
private

Referenced by operator()().

◆ i_obj

WorldObject const& Acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck::i_obj
private

Referenced by operator()().

◆ i_range

float Acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck::i_range
private

Referenced by operator()().


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