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

#include "GridNotifiers.h"

Public Member Functions

 AnyGroupedUnitInObjectRangeCheck (WorldObject const *obj, Unit const *funit, float range, bool raid)
 
bool operator() (Unit *u)
 

Private Attributes

WorldObject const * _source
 
Unit const * _refUnit
 
float _range
 
bool _raid
 

Detailed Description

Constructor & Destructor Documentation

◆ AnyGroupedUnitInObjectRangeCheck()

Acore::AnyGroupedUnitInObjectRangeCheck::AnyGroupedUnitInObjectRangeCheck ( WorldObject const *  obj,
Unit const *  funit,
float  range,
bool  raid 
)
inline
1014: _source(obj), _refUnit(funit), _range(range), _raid(raid) {}
float _range
Definition: GridNotifiers.h:1031
bool _raid
Definition: GridNotifiers.h:1032
WorldObject const * _source
Definition: GridNotifiers.h:1029
Unit const * _refUnit
Definition: GridNotifiers.h:1030

Member Function Documentation

◆ operator()()

bool Acore::AnyGroupedUnitInObjectRangeCheck::operator() ( Unit u)
inline
1016 {
1017 if (_raid)
1018 {
1019 if (!_refUnit->IsInRaidWith(u))
1020 return false;
1021 }
1022 else if (!_refUnit->IsInPartyWith(u))
1023 return false;
1024
1025 return !_refUnit->IsHostileTo(u) && u->IsAlive() && _source->IsWithinDistInMap(u, _range);
1026 }
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition: Object.cpp:1332
bool IsAlive() const
Definition: Unit.h:1654
bool IsInRaidWith(Unit const *unit) const
Definition: Unit.cpp:18797
bool IsHostileTo(Unit const *unit) const
Definition: Unit.cpp:10236
bool IsInPartyWith(Unit const *unit) const
Definition: Unit.cpp:18774

References _raid, _range, _refUnit, _source, Unit::IsAlive(), Unit::IsHostileTo(), Unit::IsInPartyWith(), Unit::IsInRaidWith(), and WorldObject::IsWithinDistInMap().

Member Data Documentation

◆ _raid

bool Acore::AnyGroupedUnitInObjectRangeCheck::_raid
private

Referenced by operator()().

◆ _range

float Acore::AnyGroupedUnitInObjectRangeCheck::_range
private

Referenced by operator()().

◆ _refUnit

Unit const* Acore::AnyGroupedUnitInObjectRangeCheck::_refUnit
private

Referenced by operator()().

◆ _source

WorldObject const* Acore::AnyGroupedUnitInObjectRangeCheck::_source
private

Referenced by operator()().