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

#include <GridNotifiers.h>

Public Member Functions

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

Private Attributes

WorldObject consti_obj
 
Unit consti_funit
 
float i_range
 

Constructor & Destructor Documentation

Trinity::AnyUnfriendlyNoTotemUnitInObjectRangeCheck::AnyUnfriendlyNoTotemUnitInObjectRangeCheck ( WorldObject const obj,
Unit const funit,
float  range 
)
inline
817 : i_obj(obj), i_funit(funit), i_range(range) { }
Unit const * i_funit
Definition: GridNotifiers.h:836
WorldObject const * i_obj
Definition: GridNotifiers.h:835
float i_range
Definition: GridNotifiers.h:837

Member Function Documentation

bool Trinity::AnyUnfriendlyNoTotemUnitInObjectRangeCheck::operator() ( Unit u)
inline
819  {
820  if (!u->IsAlive())
821  return false;
822 
824  return false;
825 
826  if (u->GetTypeId() == TYPEID_UNIT && ((Creature*)u)->IsTotem())
827  return false;
828 
829  if (!u->isTargetableForAttack(false))
830  return false;
831 
832  return i_obj->IsWithinDistInMap(u, i_range) && !i_funit->IsFriendlyTo(u);
833  }
Definition: SharedDefines.h:3565
Definition: ObjectGuid.h:32
Definition: Creature.h:467
uint32 GetCreatureType() const
Definition: Unit.cpp:11248
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition: Object.cpp:1663
TypeID GetTypeId() const
Definition: Object.h:113
Unit const * i_funit
Definition: GridNotifiers.h:836
WorldObject const * i_obj
Definition: GridNotifiers.h:835
bool IsAlive() const
Definition: Unit.h:1692
bool IsFriendlyTo(Unit const *unit) const
Definition: Unit.cpp:7170
float i_range
Definition: GridNotifiers.h:837
bool isTargetableForAttack(bool checkFakeDeath=true) const
Definition: Unit.cpp:9987

+ Here is the call graph for this function:

Member Data Documentation

Unit const* Trinity::AnyUnfriendlyNoTotemUnitInObjectRangeCheck::i_funit
private
WorldObject const* Trinity::AnyUnfriendlyNoTotemUnitInObjectRangeCheck::i_obj
private
float Trinity::AnyUnfriendlyNoTotemUnitInObjectRangeCheck::i_range
private

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