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
1407 : i_obj(obj), i_range(range)
1408 {
1409 }
WorldObject const * i_obj
Definition: GridNotifiers.h:1422
float i_range
Definition: GridNotifiers.h:1423

◆ NearestPlayerInObjectRangeCheck() [2/2]

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

Member Function Documentation

◆ operator()()

bool Acore::NearestPlayerInObjectRangeCheck::operator() ( Player u)
inline
1412 {
1413 if (u->IsAlive() && i_obj->IsWithinDistInMap(u, i_range))
1414 {
1416 return true;
1417 }
1418
1419 return false;
1420 }
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:1204

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