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

#include "GridNotifiers.h"

Public Member Functions

 AnyFriendlyUnitInObjectRangeCheck (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

◆ AnyFriendlyUnitInObjectRangeCheck()

Acore::AnyFriendlyUnitInObjectRangeCheck::AnyFriendlyUnitInObjectRangeCheck ( WorldObject const *  obj,
Unit const *  funit,
float  range,
bool  playerOnly = false 
)
inline
978: i_obj(obj), i_funit(funit), i_range(range), i_playerOnly(playerOnly) {}
float i_range
Definition: GridNotifiers.h:989
bool i_playerOnly
Definition: GridNotifiers.h:990
Unit const * i_funit
Definition: GridNotifiers.h:988
WorldObject const * i_obj
Definition: GridNotifiers.h:987

Member Function Documentation

◆ operator()()

bool Acore::AnyFriendlyUnitInObjectRangeCheck::operator() ( Unit u)
inline
980 {
981 if (u->IsAlive() && i_obj->IsWithinDistInMap(u, i_range) && i_funit->IsFriendlyTo(u) && (!i_playerOnly || u->IsPlayer()))
982 return true;
983 else
984 return false;
985 }
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::AnyFriendlyUnitInObjectRangeCheck::i_funit
private

Referenced by operator()().

◆ i_obj

WorldObject const* Acore::AnyFriendlyUnitInObjectRangeCheck::i_obj
private

Referenced by operator()().

◆ i_playerOnly

bool Acore::AnyFriendlyUnitInObjectRangeCheck::i_playerOnly
private

Referenced by operator()().

◆ i_range

float Acore::AnyFriendlyUnitInObjectRangeCheck::i_range
private

Referenced by operator()().