AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Acore::CreatureSearcher< Check > Struct Template Reference

#include "GridNotifiers.h"

Public Member Functions

 CreatureSearcher (WorldObject const *searcher, Creature *&result, Check &check)
 
void Visit (CreatureMapType &m)
 
template<class NOT_INTERESTED >
void Visit (GridRefMgr< NOT_INTERESTED > &)
 

Public Attributes

uint32 i_phaseMask
 
Creature *& i_object
 
Check & i_check
 

Detailed Description

template<class Check>
struct Acore::CreatureSearcher< Check >

Constructor & Destructor Documentation

◆ CreatureSearcher()

template<class Check >
Acore::CreatureSearcher< Check >::CreatureSearcher ( WorldObject const *  searcher,
Creature *&  result,
Check &  check 
)
inline
448 : i_phaseMask(searcher->GetPhaseMask()), i_object(result), i_check(check) {}
uint32 i_phaseMask
Definition: GridNotifiers.h:443
Check & i_check
Definition: GridNotifiers.h:445
Creature *& i_object
Definition: GridNotifiers.h:444

Member Function Documentation

◆ Visit() [1/2]

template<class Check >
void Acore::CreatureSearcher< Check >::Visit ( CreatureMapType m)
437{
438 // already found
439 if (i_object)
440 return;
441
442 for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
443 {
444 if (!itr->GetSource()->InSamePhase(i_phaseMask))
445 continue;
446
447 if (i_check(itr->GetSource()))
448 {
449 i_object = itr->GetSource();
450 return;
451 }
452 }
453}
Definition: LinkedList.h:139
iterator begin()
Definition: GridRefMgr.h:35
iterator end()
Definition: GridRefMgr.h:36

References GridRefMgr< OBJECT >::begin(), and GridRefMgr< OBJECT >::end().

◆ Visit() [2/2]

template<class Check >
template<class NOT_INTERESTED >
void Acore::CreatureSearcher< Check >::Visit ( GridRefMgr< NOT_INTERESTED > &  )
inline
452{}

Member Data Documentation

◆ i_check

template<class Check >
Check& Acore::CreatureSearcher< Check >::i_check

◆ i_object

template<class Check >
Creature*& Acore::CreatureSearcher< Check >::i_object

◆ i_phaseMask

template<class Check >
uint32 Acore::CreatureSearcher< Check >::i_phaseMask