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)
433{
434 // already found
435 if (i_object)
436 return;
437
438 for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
439 {
440 if (!itr->GetSource()->InSamePhase(i_phaseMask))
441 continue;
442
443 if (i_check(itr->GetSource()))
444 {
445 i_object = itr->GetSource();
446 return;
447 }
448 }
449}
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