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

#include <GridNotifiers.h>

Public Member Functions

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

Private Attributes

WorldObject const_source
 
Unit const_refUnit
 
float _range
 
bool _raid
 

Constructor & Destructor Documentation

Trinity::AnyGroupedUnitInObjectRangeCheck::AnyGroupedUnitInObjectRangeCheck ( WorldObject const obj,
Unit const funit,
float  range,
bool  raid 
)
inline
861 : _source(obj), _refUnit(funit), _range(range), _raid(raid) { }
Unit const * _refUnit
Definition: GridNotifiers.h:880
WorldObject const * _source
Definition: GridNotifiers.h:879
bool _raid
Definition: GridNotifiers.h:882
float _range
Definition: GridNotifiers.h:881

Member Function Documentation

bool Trinity::AnyGroupedUnitInObjectRangeCheck::operator() ( Unit u)
inline
863  {
864  if (G3D::fuzzyEq(_range, 0))
865  return false;
866 
867  if (_raid)
868  {
869  if (!_refUnit->IsInRaidWith(u))
870  return false;
871  }
872  else if (!_refUnit->IsInPartyWith(u))
873  return false;
874 
875  return !_refUnit->IsHostileTo(u) && u->IsAlive() && _source->IsWithinDistInMap(u, _range);
876  }
bool IsInPartyWith(Unit const *unit) const
Definition: Unit.cpp:14372
Unit const * _refUnit
Definition: GridNotifiers.h:880
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition: Object.cpp:1663
WorldObject const * _source
Definition: GridNotifiers.h:879
bool IsAlive() const
Definition: Unit.h:1692
bool _raid
Definition: GridNotifiers.h:882
bool IsHostileTo(Unit const *unit) const
Definition: Unit.cpp:7165
bool IsInRaidWith(Unit const *unit) const
Definition: Unit.cpp:14391
bool fuzzyEq(double a, double b)
Definition: g3dmath.h:857
float _range
Definition: GridNotifiers.h:881

+ Here is the call graph for this function:

Member Data Documentation

bool Trinity::AnyGroupedUnitInObjectRangeCheck::_raid
private
float Trinity::AnyGroupedUnitInObjectRangeCheck::_range
private
Unit const* Trinity::AnyGroupedUnitInObjectRangeCheck::_refUnit
private
WorldObject const* Trinity::AnyGroupedUnitInObjectRangeCheck::_source
private

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