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

#include "GridNotifiers.h"

Public Member Functions

 PlayerSearcher (WorldObject const *searcher, Player *&result, Check &check)
 
void Visit (PlayerMapType &m)
 
template<class NOT_INTERESTED >
void Visit (GridRefMgr< NOT_INTERESTED > &)
 

Public Attributes

uint32 i_phaseMask
 
Player *& i_object
 
Check & i_check
 

Detailed Description

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

Constructor & Destructor Documentation

◆ PlayerSearcher()

template<class Check >
Acore::PlayerSearcher< Check >::PlayerSearcher ( WorldObject const *  searcher,
Player *&  result,
Check &  check 
)
inline
513 : i_phaseMask(searcher->GetPhaseMask()), i_object(result), i_check(check) {}
Check & i_check
Definition: GridNotifiers.h:510
uint32 i_phaseMask
Definition: GridNotifiers.h:508
Player *& i_object
Definition: GridNotifiers.h:509

Member Function Documentation

◆ Visit() [1/2]

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

◆ Visit() [2/2]

template<class Check >
void Acore::PlayerSearcher< Check >::Visit ( PlayerMapType m)
507{
508 // already found
509 if (i_object)
510 return;
511
512 for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
513 {
514 if (!itr->GetSource()->InSamePhase(i_phaseMask))
515 continue;
516
517 if (i_check(itr->GetSource()))
518 {
519 i_object = itr->GetSource();
520 return;
521 }
522 }
523}
Definition: LinkedList.h:139
iterator begin()
Definition: GridRefMgr.h:35
iterator end()
Definition: GridRefMgr.h:36

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

Member Data Documentation

◆ i_check

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

◆ i_object

template<class Check >
Player*& Acore::PlayerSearcher< Check >::i_object

◆ i_phaseMask

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