AzeorthCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Acore::NearestAssistCreatureInCreatureRangeCheck Class Reference

#include "GridNotifiers.h"

Public Member Functions

 NearestAssistCreatureInCreatureRangeCheck (Creature *obj, Unit *enemy, float range)
 
bool operator() (Creature *u)
 

Private Member Functions

 NearestAssistCreatureInCreatureRangeCheck (NearestAssistCreatureInCreatureRangeCheck const &)
 

Private Attributes

Creature *const i_obj
 
Unit *const i_enemy
 
float i_range
 

Detailed Description

Constructor & Destructor Documentation

◆ NearestAssistCreatureInCreatureRangeCheck() [1/2]

Acore::NearestAssistCreatureInCreatureRangeCheck::NearestAssistCreatureInCreatureRangeCheck ( Creature obj,
Unit enemy,
float  range 
)
inline
1299 : i_obj(obj), i_enemy(enemy), i_range(range) {}
Unit *const i_enemy
Definition: GridNotifiers.h:1319
Creature *const i_obj
Definition: GridNotifiers.h:1318
float i_range
Definition: GridNotifiers.h:1320

◆ NearestAssistCreatureInCreatureRangeCheck() [2/2]

Acore::NearestAssistCreatureInCreatureRangeCheck::NearestAssistCreatureInCreatureRangeCheck ( NearestAssistCreatureInCreatureRangeCheck const &  )
private

Member Function Documentation

◆ operator()()

bool Acore::NearestAssistCreatureInCreatureRangeCheck::operator() ( Creature u)
inline
1302 {
1303 if (u == i_obj)
1304 return false;
1305 if (!u->CanAssistTo(i_obj, i_enemy))
1306 return false;
1307
1309 return false;
1310
1311 if (!i_obj->IsWithinLOSInMap(u))
1312 return false;
1313
1314 i_range = i_obj->GetDistance(u); // use found unit range as new range limit for next check
1315 return true;
1316 }
bool CanAssistTo(Unit const *u, Unit const *enemy, bool checkfaction=true) const
Definition: Creature.cpp:2485
bool IsWithinLOSInMap(WorldObject const *obj, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, Optional< float > collisionHeight={ }) const
Definition: Object.cpp:1349
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true, bool useBoundingRadius=true) const
Definition: Object.cpp:1323
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1247

References Creature::CanAssistTo(), WorldObject::GetDistance(), i_enemy, i_obj, i_range, WorldObject::IsWithinDistInMap(), and WorldObject::IsWithinLOSInMap().

Member Data Documentation

◆ i_enemy

Unit* const Acore::NearestAssistCreatureInCreatureRangeCheck::i_enemy
private

Referenced by operator()().

◆ i_obj

Creature* const Acore::NearestAssistCreatureInCreatureRangeCheck::i_obj
private

Referenced by operator()().

◆ i_range

float Acore::NearestAssistCreatureInCreatureRangeCheck::i_range
private

Referenced by operator()().