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 
)
9065 : WorldObjectSpellTargetCheck(caster, caster, spellInfo, selectionType, condList), _range(range), _position(caster)
9066 {
9067 }
Position const * _position
Definition Spell.h:808
float _range
Definition Spell.h:807
WorldObjectSpellTargetCheck(Unit *caster, Unit *referer, SpellInfo const *spellInfo, SpellTargetCheckTypes selectionType, ConditionList *condList)
Definition Spell.cpp:8984

Member Function Documentation

◆ operator()()

bool Acore::WorldObjectSpellNearbyTargetCheck::operator() ( WorldObject target)
9070 {
9071 float dist = target->GetDistance(*_position);
9072 if (dist < _range && WorldObjectSpellTargetCheck::operator ()(target))
9073 {
9074 _range = dist;
9075 return true;
9076 }
9077 return false;
9078 }
float GetDistance(WorldObject const *obj) const
Definition Object.cpp:1256

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()().


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