TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Trinity::AnyAssistCreatureInRangeCheck Class Reference

#include <GridNotifiers.h>

Public Member Functions

 AnyAssistCreatureInRangeCheck (Unit *funit, Unit *enemy, float range)
 
bool operator() (Creature *u)
 

Private Attributes

Unit *const i_funit
 
Unit *const i_enemy
 
float i_range
 

Constructor & Destructor Documentation

Trinity::AnyAssistCreatureInRangeCheck::AnyAssistCreatureInRangeCheck ( Unit funit,
Unit enemy,
float  range 
)
inline
1102  : i_funit(funit), i_enemy(enemy), i_range(range)
1103  {
1104  }
Unit *const i_funit
Definition: GridNotifiers.h:1124
float i_range
Definition: GridNotifiers.h:1126
Unit *const i_enemy
Definition: GridNotifiers.h:1125

Member Function Documentation

bool Trinity::AnyAssistCreatureInRangeCheck::operator() ( Creature u)
inline
1106  {
1107  if (u == i_funit)
1108  return false;
1109 
1110  if (!u->CanAssistTo(i_funit, i_enemy))
1111  return false;
1112 
1113  // too far
1114  if (!i_funit->IsWithinDistInMap(u, i_range))
1115  return false;
1116 
1117  // only if see assisted creature
1118  if (!i_funit->IsWithinLOSInMap(u))
1119  return false;
1120 
1121  return true;
1122  }
bool IsWithinLOSInMap(WorldObject const *obj) const
Definition: Object.cpp:1584
Unit *const i_funit
Definition: GridNotifiers.h:1124
float i_range
Definition: GridNotifiers.h:1126
bool CanAssistTo(const Unit *u, const Unit *enemy, bool checkfaction=true) const
Definition: Creature.cpp:2078
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition: Object.cpp:1663
Unit *const i_enemy
Definition: GridNotifiers.h:1125

+ Here is the call graph for this function:

Member Data Documentation

Unit* const Trinity::AnyAssistCreatureInRangeCheck::i_enemy
private
Unit* const Trinity::AnyAssistCreatureInRangeCheck::i_funit
private
float Trinity::AnyAssistCreatureInRangeCheck::i_range
private

The documentation for this class was generated from the following file: