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

#include "GridNotifiers.h"

Public Member Functions

 AnyFriendlyNotSelfUnitInObjectRangeCheck (WorldObject const *obj, Unit const *funit, float range, bool playerOnly=false)
 
bool operator() (Unit *u)
 

Private Attributes

WorldObject const * i_obj
 
Unit const * i_funit
 
float i_range
 
bool i_playerOnly
 

Detailed Description

Constructor & Destructor Documentation

◆ AnyFriendlyNotSelfUnitInObjectRangeCheck()

Acore::AnyFriendlyNotSelfUnitInObjectRangeCheck::AnyFriendlyNotSelfUnitInObjectRangeCheck ( WorldObject const *  obj,
Unit const *  funit,
float  range,
bool  playerOnly = false 
)
inline
996: i_obj(obj), i_funit(funit), i_range(range), i_playerOnly(playerOnly) {}
bool i_playerOnly
Definition: GridNotifiers.h:1008
Unit const * i_funit
Definition: GridNotifiers.h:1006
WorldObject const * i_obj
Definition: GridNotifiers.h:1005
float i_range
Definition: GridNotifiers.h:1007

Member Function Documentation

◆ operator()()

bool Acore::AnyFriendlyNotSelfUnitInObjectRangeCheck::operator() ( Unit u)
inline
998 {
999 if (u != i_obj && u->IsAlive() && i_obj->IsWithinDistInMap(u, i_range) && i_funit->IsFriendlyTo(u) && (!i_playerOnly || u->IsPlayer()))
1000 return true;
1001 else
1002 return false;
1003 }
bool IsPlayer() const
Definition: Object.h:200
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 IsFriendlyTo(Unit const *unit) const
Definition: Unit.cpp:10241

References i_funit, i_obj, i_playerOnly, i_range, Unit::IsAlive(), Unit::IsFriendlyTo(), Object::IsPlayer(), and WorldObject::IsWithinDistInMap().

Member Data Documentation

◆ i_funit

Unit const* Acore::AnyFriendlyNotSelfUnitInObjectRangeCheck::i_funit
private

Referenced by operator()().

◆ i_obj

WorldObject const* Acore::AnyFriendlyNotSelfUnitInObjectRangeCheck::i_obj
private

Referenced by operator()().

◆ i_playerOnly

bool Acore::AnyFriendlyNotSelfUnitInObjectRangeCheck::i_playerOnly
private

Referenced by operator()().

◆ i_range

float Acore::AnyFriendlyNotSelfUnitInObjectRangeCheck::i_range
private

Referenced by operator()().