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

#include "GridNotifiers.h"

Public Member Functions

 AnyPlayerInObjectRangeCheck (WorldObject const *obj, float range, bool reqAlive=true, bool disallowGM=false)
 
bool operator() (Player *u)
 
bool operator() (Player *u, bool checkRange)
 

Private Attributes

WorldObject const * _obj
 
float _range
 
bool _reqAlive
 
bool _disallowGM
 

Detailed Description

Constructor & Destructor Documentation

◆ AnyPlayerInObjectRangeCheck()

Acore::AnyPlayerInObjectRangeCheck::AnyPlayerInObjectRangeCheck ( WorldObject const *  obj,
float  range,
bool  reqAlive = true,
bool  disallowGM = false 
)
inline
1351: _obj(obj), _range(range), _reqAlive(reqAlive), _disallowGM(disallowGM) {}
WorldObject const * _obj
Definition GridNotifiers.h:1376
bool _disallowGM
Definition GridNotifiers.h:1379
float _range
Definition GridNotifiers.h:1377
bool _reqAlive
Definition GridNotifiers.h:1378

Member Function Documentation

◆ operator()() [1/2]

bool Acore::AnyPlayerInObjectRangeCheck::operator() ( Player u)
inline
1353 {
1354 if (_reqAlive && !u->IsAlive())
1355 return false;
1356
1357 if (_disallowGM && (u->IsGameMaster() || u->IsSpectator()))
1358 return false;
1359
1360 if (!_obj->IsWithinDistInMap(u, _range))
1361 return false;
1362
1363 return true;
1364 }
bool IsGameMaster() const
Definition Player.h:1166
bool IsSpectator() const
Definition Player.h:2585
bool IsAlive() const
Definition Unit.h:1710
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition Object.cpp:1326

References _disallowGM, _obj, _range, _reqAlive, Unit::IsAlive(), Player::IsGameMaster(), Player::IsSpectator(), and WorldObject::IsWithinDistInMap().

◆ operator()() [2/2]

bool Acore::AnyPlayerInObjectRangeCheck::operator() ( Player u,
bool  checkRange 
)
inline
1368 {
1369 if (checkRange && !_obj->IsWithinDistInMap(u, _range))
1370 return false;
1371
1372 return true;
1373 }

References _obj, _range, and WorldObject::IsWithinDistInMap().

Member Data Documentation

◆ _disallowGM

bool Acore::AnyPlayerInObjectRangeCheck::_disallowGM
private

Referenced by operator()().

◆ _obj

WorldObject const* Acore::AnyPlayerInObjectRangeCheck::_obj
private

Referenced by operator()(), and operator()().

◆ _range

float Acore::AnyPlayerInObjectRangeCheck::_range
private

Referenced by operator()(), and operator()().

◆ _reqAlive

bool Acore::AnyPlayerInObjectRangeCheck::_reqAlive
private

Referenced by operator()().


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