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

#include "GridNotifiers.h"

Public Member Functions

 NearestPlayerInObjectRangeCheck (WorldObject const *obj, float range)
 
bool operator() (Player *u)
 

Private Member Functions

 NearestPlayerInObjectRangeCheck (NearestPlayerInObjectRangeCheck const &)
 

Private Attributes

WorldObject const * i_obj
 
float i_range
 

Detailed Description

Constructor & Destructor Documentation

◆ NearestPlayerInObjectRangeCheck() [1/2]

Acore::NearestPlayerInObjectRangeCheck::NearestPlayerInObjectRangeCheck ( WorldObject const *  obj,
float  range 
)
inline
1403 : i_obj(obj), i_range(range)
1404 {
1405 }
WorldObject const * i_obj
Definition: GridNotifiers.h:1418
float i_range
Definition: GridNotifiers.h:1419

◆ NearestPlayerInObjectRangeCheck() [2/2]

Acore::NearestPlayerInObjectRangeCheck::NearestPlayerInObjectRangeCheck ( NearestPlayerInObjectRangeCheck const &  )
private

Member Function Documentation

◆ operator()()

bool Acore::NearestPlayerInObjectRangeCheck::operator() ( Player u)
inline
1408 {
1409 if (u->IsAlive() && i_obj->IsWithinDistInMap(u, i_range))
1410 {
1412 return true;
1413 }
1414
1415 return false;
1416 }
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition: Object.cpp:1321
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1245
bool IsAlive() const
Definition: Unit.h:1822

References WorldObject::GetDistance(), i_obj, i_range, Unit::IsAlive(), and WorldObject::IsWithinDistInMap().

Member Data Documentation

◆ i_obj

WorldObject const* Acore::NearestPlayerInObjectRangeCheck::i_obj
private

Referenced by operator()().

◆ i_range

float Acore::NearestPlayerInObjectRangeCheck::i_range
private

Referenced by operator()().