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
1332 : i_obj(obj), i_entry(entry), i_alive(alive), i_range(range) {}
float i_range
Definition: GridNotifiers.h:1347
WorldObject const & i_obj
Definition: GridNotifiers.h:1344
uint32 i_entry
Definition: GridNotifiers.h:1345

◆ NearestCreatureEntryWithLiveStateInObjectRangeCheck() [2/2]

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

Member Function Documentation

◆ operator()()

bool Acore::NearestCreatureEntryWithLiveStateInObjectRangeCheck::operator() ( Creature u)
inline
1335 {
1336 if (u->GetEntry() == i_entry && u->IsAlive() == i_alive && i_obj.IsWithinDist(u, i_range) && i_obj.InSamePhase(u))
1337 {
1338 i_range = i_obj.GetDistance(u); // use found unit range as new range limit for next check
1339 return true;
1340 }
1341 return false;
1342 }
uint32 GetEntry() const
Definition: Object.h:112
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:447
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1245
bool IsAlive() const
Definition: Unit.h:1204

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