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
1328 : i_obj(obj), i_entry(entry), i_alive(alive), i_range(range) {}
float i_range
Definition: GridNotifiers.h:1343
WorldObject const & i_obj
Definition: GridNotifiers.h:1340
uint32 i_entry
Definition: GridNotifiers.h:1341

◆ NearestCreatureEntryWithLiveStateInObjectRangeCheck() [2/2]

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

Member Function Documentation

◆ operator()()

bool Acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck::operator() ( Creature u)
inline
1331 {
1332 if (u->GetEntry() == i_entry && u->IsAlive() == i_alive && i_obj.IsWithinDist(u, i_range) && i_obj.InSamePhase(u))
1333 {
1334 i_range = i_obj.GetDistance(u); // use found unit range as new range limit for next check
1335 return true;
1336 }
1337 return false;
1338 }
uint32 GetEntry() const
Definition: Object.h:109
bool IsWithinDist(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition: Object.cpp:1316
bool InSamePhase(WorldObject const *obj) const
Definition: Object.h:435
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1245
bool IsAlive() const
Definition: Unit.h:1822

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()().