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

#include "GridNotifiers.h"

Public Member Functions

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

Private Member Functions

 NearestAttackableUnitInObjectRangeCheck (NearestAttackableUnitInObjectRangeCheck const &)
 

Private Attributes

WorldObject const * i_obj
 
Unit const * i_funit
 
float i_range
 

Detailed Description

Constructor & Destructor Documentation

◆ NearestAttackableUnitInObjectRangeCheck() [1/2]

Acore::NearestAttackableUnitInObjectRangeCheck::NearestAttackableUnitInObjectRangeCheck ( WorldObject const *  obj,
Unit const *  funit,
float  range 
)
inline
1055: i_obj(obj), i_funit(funit), i_range(range) {}
float i_range
Definition: GridNotifiers.h:1070
WorldObject const * i_obj
Definition: GridNotifiers.h:1068
Unit const * i_funit
Definition: GridNotifiers.h:1069

◆ NearestAttackableUnitInObjectRangeCheck() [2/2]

Acore::NearestAttackableUnitInObjectRangeCheck::NearestAttackableUnitInObjectRangeCheck ( NearestAttackableUnitInObjectRangeCheck const &  )
private

Member Function Documentation

◆ operator()()

bool Acore::NearestAttackableUnitInObjectRangeCheck::operator() ( Unit u)
inline
1057 {
1060 {
1061 i_range = i_obj->GetDistance(u); // use found unit range as new range limit for next check
1062 return true;
1063 }
1064
1065 return false;
1066 }
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition: Object.cpp:1332
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1256
bool CanSeeOrDetect(WorldObject const *obj, bool ignoreStealth=false, bool distanceCheck=false, bool checkAlert=false) const
Definition: Object.cpp:1737
bool IsInCombatWith(Unit const *who) const
Definition: Unit.cpp:21038
bool isTargetableForAttack(bool checkFakeDeath=true, Unit const *byWho=nullptr) const
Definition: Unit.cpp:13854
bool IsHostileTo(Unit const *unit) const
Definition: Unit.cpp:10236

References WorldObject::CanSeeOrDetect(), WorldObject::GetDistance(), i_funit, i_obj, i_range, Unit::IsHostileTo(), Unit::IsInCombatWith(), Unit::isTargetableForAttack(), and WorldObject::IsWithinDistInMap().

Member Data Documentation

◆ i_funit

Unit const* Acore::NearestAttackableUnitInObjectRangeCheck::i_funit
private

Referenced by operator()().

◆ i_obj

WorldObject const* Acore::NearestAttackableUnitInObjectRangeCheck::i_obj
private

Referenced by operator()().

◆ i_range

float Acore::NearestAttackableUnitInObjectRangeCheck::i_range
private

Referenced by operator()().