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

#include <UnitAI.h>

Public Member Functions

 NonTankTargetSelector (Creature *source, bool playerOnly=true)
 
bool operator() (Unit const *target) const
 

Private Attributes

Creature const_source
 
bool _playerOnly
 

Constructor & Destructor Documentation

NonTankTargetSelector::NonTankTargetSelector ( Creature source,
bool  playerOnly = true 
)
inline
110 : _source(source), _playerOnly(playerOnly) { }
bool _playerOnly
Definition: UnitAI.h:115
Creature const * _source
Definition: UnitAI.h:114

Member Function Documentation

bool NonTankTargetSelector::operator() ( Unit const target) const
305 {
306  if (!target)
307  return false;
308 
309  if (_playerOnly && target->GetTypeId() != TYPEID_PLAYER)
310  return false;
311 
312  return target != _source->GetVictim();
313 }
bool _playerOnly
Definition: UnitAI.h:115
Unit * GetVictim() const
Definition: Unit.h:1379
Definition: ObjectGuid.h:33
Creature const * _source
Definition: UnitAI.h:114

+ Here is the call graph for this function:

Member Data Documentation

bool NonTankTargetSelector::_playerOnly
private
Creature const* NonTankTargetSelector::_source
private

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