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

#include <GridNotifiers.h>

Public Member Functions

 MostHPMissingInRange (Unit const *obj, float range, uint32 hp)
 
bool operator() (Unit *u)
 

Private Attributes

Unit consti_obj
 
float i_range
 
uint32 i_hp
 

Constructor & Destructor Documentation

Trinity::MostHPMissingInRange::MostHPMissingInRange ( Unit const obj,
float  range,
uint32  hp 
)
inline
744 : i_obj(obj), i_range(range), i_hp(hp) { }
uint32 i_hp
Definition: GridNotifiers.h:757
float i_range
Definition: GridNotifiers.h:756
Unit const * i_obj
Definition: GridNotifiers.h:755

Member Function Documentation

bool Trinity::MostHPMissingInRange::operator() ( Unit u)
inline
746  {
747  if (u->IsAlive() && u->IsInCombat() && !i_obj->IsHostileTo(u) && i_obj->IsWithinDistInMap(u, i_range) && u->GetMaxHealth() - u->GetHealth() > i_hp)
748  {
749  i_hp = u->GetMaxHealth() - u->GetHealth();
750  return true;
751  }
752  return false;
753  }
uint32 GetMaxHealth() const
Definition: Unit.h:1427
bool IsInCombat() const
Definition: Unit.h:1584
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
Definition: Object.cpp:1663
uint32 i_hp
Definition: GridNotifiers.h:757
float i_range
Definition: GridNotifiers.h:756
bool IsAlive() const
Definition: Unit.h:1692
bool IsHostileTo(Unit const *unit) const
Definition: Unit.cpp:7165
uint32 GetHealth() const
Definition: Unit.h:1426
Unit const * i_obj
Definition: GridNotifiers.h:755

+ Here is the call graph for this function:

Member Data Documentation

uint32 Trinity::MostHPMissingInRange::i_hp
private
Unit const* Trinity::MostHPMissingInRange::i_obj
private
float Trinity::MostHPMissingInRange::i_range
private

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