AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Acore::WorldObjectSpellNearbyTargetCheck Struct Reference

#include "Spell.h"

Inheritance diagram for Acore::WorldObjectSpellNearbyTargetCheck:
Acore::WorldObjectSpellTargetCheck

Public Member Functions

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

Public Attributes

float _range
 
Position const * _position
 
- Public Attributes inherited from Acore::WorldObjectSpellTargetCheck
Unit_caster
 
Unit_referer
 
SpellInfo const * _spellInfo
 
SpellTargetCheckTypes _targetSelectionType
 
ConditionSourceInfo_condSrcInfo
 
ConditionList_condList
 

Detailed Description

Constructor & Destructor Documentation

◆ WorldObjectSpellNearbyTargetCheck()

Acore::WorldObjectSpellNearbyTargetCheck::WorldObjectSpellNearbyTargetCheck ( float  range,
Unit caster,
SpellInfo const *  spellInfo,
SpellTargetCheckTypes  selectionType,
ConditionList condList 
)
8983 : WorldObjectSpellTargetCheck(caster, caster, spellInfo, selectionType, condList), _range(range), _position(caster)
8984 {
8985 }
WorldObjectSpellTargetCheck(Unit *caster, Unit *referer, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionList *condList)
Definition: Spell.cpp:8902
Position const * _position
Definition: Spell.h:811
float _range
Definition: Spell.h:810

Member Function Documentation

◆ operator()()

bool Acore::WorldObjectSpellNearbyTargetCheck::operator() ( WorldObject target)
8988 {
8989 float dist = target->GetDistance(*_position);
8990 if (dist < _range && WorldObjectSpellTargetCheck::operator ()(target))
8991 {
8992 _range = dist;
8993 return true;
8994 }
8995 return false;
8996 }
float GetDistance(WorldObject const *obj) const
Definition: Object.cpp:1245

References _position, _range, and WorldObject::GetDistance().

Member Data Documentation

◆ _position

Position const* Acore::WorldObjectSpellNearbyTargetCheck::_position

Referenced by operator()().

◆ _range

float Acore::WorldObjectSpellNearbyTargetCheck::_range

Referenced by operator()().