AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
ClassCallSelector Struct Reference
Inheritance diagram for ClassCallSelector:
Acore::unary_function< Unit *, bool >

Public Member Functions

 ClassCallSelector (Unit const *unit, uint8 targetClass)
 
bool operator() (Unit const *target) const
 

Private Attributes

Unit const * _me
 
uint8 _targetClass
 

Additional Inherited Members

- Public Types inherited from Acore::unary_function< Unit *, bool >
typedef Unitargument_type
 
typedef bool result_type
 

Detailed Description

Constructor & Destructor Documentation

◆ ClassCallSelector()

ClassCallSelector::ClassCallSelector ( Unit const *  unit,
uint8  targetClass 
)
inline
206: _me(unit), _targetClass(targetClass) { }
Unit const * _me
Definition: boss_nefarian.cpp:224
uint8 _targetClass
Definition: boss_nefarian.cpp:225

Member Function Documentation

◆ operator()()

bool ClassCallSelector::operator() ( Unit const *  target) const
inline
209 {
210 if (!_me || !target || target->GetTypeId() != TYPEID_PLAYER)
211 {
212 return false;
213 }
214
215 if (target->getClass() != _targetClass)
216 {
217 return false;
218 }
219
220 return true;
221 }
@ TYPEID_PLAYER
Definition: ObjectGuid.h:38
TypeID GetTypeId() const
Definition: Object.h:121

References _me, _targetClass, Unit::getClass(), Object::GetTypeId(), and TYPEID_PLAYER.

Member Data Documentation

◆ _me

Unit const* ClassCallSelector::_me
private

Referenced by operator()().

◆ _targetClass

uint8 ClassCallSelector::_targetClass
private

Referenced by operator()().