AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
ShadowTrapLKTargetSelector Struct Reference

Public Member Functions

 ShadowTrapLKTargetSelector (Creature *source, bool playerOnly=true, bool reqLOS=false, float maxDist=0.0f)
 
bool operator() (Unit const *target) const
 

Private Attributes

Creature const * _source
 
bool _playerOnly
 
bool _reqLOS
 
float _maxDist
 

Detailed Description

Constructor & Destructor Documentation

◆ ShadowTrapLKTargetSelector()

ShadowTrapLKTargetSelector::ShadowTrapLKTargetSelector ( Creature source,
bool  playerOnly = true,
bool  reqLOS = false,
float  maxDist = 0.0f 
)
inline
377: _source(source), _playerOnly(playerOnly), _reqLOS(reqLOS), _maxDist(maxDist) { }
float _maxDist
Definition: boss_the_lich_king.cpp:397
bool _reqLOS
Definition: boss_the_lich_king.cpp:396
bool _playerOnly
Definition: boss_the_lich_king.cpp:395
Creature const * _source
Definition: boss_the_lich_king.cpp:394

Member Function Documentation

◆ operator()()

bool ShadowTrapLKTargetSelector::operator() ( Unit const *  target) const
inline
379 {
380 if (!target)
381 return false;
382 if (!target->IsAlive())
383 return false;
384 if (_playerOnly && target->GetTypeId() != TYPEID_PLAYER)
385 return false;
386 if (_maxDist && _source->GetExactDist(target) > _maxDist)
387 return false;
388 if (_reqLOS && !_source->IsWithinLOSInMap(target))
389 return false;
390 return true;
391 }
@ TYPEID_PLAYER
Definition: ObjectGuid.h:38
bool IsWithinLOSInMap(WorldObject const *obj, VMAP::ModelIgnoreFlags ignoreFlags=VMAP::ModelIgnoreFlags::Nothing, LineOfSightChecks checks=LINEOFSIGHT_ALL_CHECKS, Optional< float > collisionHeight={ }, Optional< float > combatReach={ }) const
Definition: Object.cpp:1347
float GetExactDist(float x, float y, float z) const
Definition: Position.h:178

References _maxDist, _playerOnly, _reqLOS, _source, Position::GetExactDist(), Object::GetTypeId(), Unit::IsAlive(), WorldObject::IsWithinLOSInMap(), and TYPEID_PLAYER.

Member Data Documentation

◆ _maxDist

float ShadowTrapLKTargetSelector::_maxDist
private

Referenced by operator()().

◆ _playerOnly

bool ShadowTrapLKTargetSelector::_playerOnly
private

Referenced by operator()().

◆ _reqLOS

bool ShadowTrapLKTargetSelector::_reqLOS
private

Referenced by operator()().

◆ _source

Creature const* ShadowTrapLKTargetSelector::_source
private

Referenced by operator()().