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 
)
9016 : WorldObjectSpellTargetCheck(caster, caster, spellInfo, selectionType, condList), _range(range), _position(caster)
9017 {
9018 }
WorldObjectSpellTargetCheck(Unit *caster, Unit *referer, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionList *condList)
Definition: Spell.cpp:8935
Position const * _position
Definition: Spell.h:812
float _range
Definition: Spell.h:811

Member Function Documentation

◆ operator()()

bool Acore::WorldObjectSpellNearbyTargetCheck::operator() ( WorldObject target)
9021 {
9022 float dist = target->GetDistance(*_position);
9023 if (dist < _range && WorldObjectSpellTargetCheck::operator ()(target))
9024 {
9025 _range = dist;
9026 return true;
9027 }
9028 return false;
9029 }
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()().