AzerothCore 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
1300 : i_obj(obj), i_enemy(enemy), i_range(range) {}
Unit *const i_enemy
Definition: GridNotifiers.h:1320
Creature *const i_obj
Definition: GridNotifiers.h:1319
float i_range
Definition: GridNotifiers.h:1321

◆ NearestAssistCreatureInCreatureRangeCheck() [2/2]

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

Member Function Documentation

◆ operator()()

bool Acore::NearestAssistCreatureInCreatureRangeCheck::operator() ( Creature u)
inline
1303 {
1304 if (u == i_obj)
1305 return false;
1306 if (!u->CanAssistTo(i_obj, i_enemy))
1307 return false;
1308
1310 return false;
1311
1312 if (!i_obj->IsWithinLOSInMap(u))
1313 return false;
1314
1315 i_range = i_obj->GetDistance(u); // use found unit range as new range limit for next check
1316 return true;
1317 }
bool CanAssistTo(Unit const *u, Unit const *enemy, bool checkfaction=true) const
Definition: Creature.cpp:2491
bool IsWithinLOSInMap(WorldObject const *obj, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, Optional< float > collisionHeight={ }, Optional< float > combatReach={ }) const
Definition: Object.cpp:1358
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

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()().