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

#include <Spell.h>

Public Member Functions

 WorldObjectSpellNearbyTargetCheck (float range, Unit *caster, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer *condList)
 
bool operator() (WorldObject *target)
 
- Public Member Functions inherited from Trinity::WorldObjectSpellTargetCheck
 WorldObjectSpellTargetCheck (Unit *caster, Unit *referer, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer *condList)
 
 ~WorldObjectSpellTargetCheck ()
 
bool operator() (WorldObject *target)
 

Public Attributes

float _range
 
Position const_position
 
- Public Attributes inherited from Trinity::WorldObjectSpellTargetCheck
Unit_caster
 
Unit_referer
 
SpellInfo const_spellInfo
 
SpellTargetCheckTypes _targetSelectionType
 
ConditionSourceInfo_condSrcInfo
 
ConditionContainer_condList
 

Constructor & Destructor Documentation

Trinity::WorldObjectSpellNearbyTargetCheck::WorldObjectSpellNearbyTargetCheck ( float  range,
Unit caster,
SpellInfo const spellInfo,
SpellTargetCheckTypes  selectionType,
ConditionContainer condList 
)
7499  : WorldObjectSpellTargetCheck(caster, caster, spellInfo, selectionType, condList), _range(range), _position(caster) { }
Position const * _position
Definition: Spell.h:873
float _range
Definition: Spell.h:872
WorldObjectSpellTargetCheck(Unit *caster, Unit *referer, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionContainer *condList)
Definition: Spell.cpp:7423

Member Function Documentation

bool Trinity::WorldObjectSpellNearbyTargetCheck::operator() ( WorldObject target)
7502 {
7503  float dist = target->GetDistance(*_position);
7504  if (dist < _range && WorldObjectSpellTargetCheck::operator ()(target))
7505  {
7506  _range = dist;
7507  return true;
7508  }
7509  return false;
7510 }
Position const * _position
Definition: Spell.h:873
float _range
Definition: Spell.h:872
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1594

+ Here is the call graph for this function:

Member Data Documentation

Position const* Trinity::WorldObjectSpellNearbyTargetCheck::_position
float Trinity::WorldObjectSpellNearbyTargetCheck::_range

The documentation for this struct was generated from the following files: