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
516 : i_phaseMask(searcher->GetPhaseMask()), i_object(result), i_check(check) {}
Check & i_check
Definition: GridNotifiers.h:513
uint32 i_phaseMask
Definition: GridNotifiers.h:511
Player *& i_object
Definition: GridNotifiers.h:512

Member Function Documentation

◆ Visit() [1/2]

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

◆ Visit() [2/2]

template<class Check >
void Acore::PlayerSearcher< Check >::Visit ( PlayerMapType m)
503{
504 // already found
505 if (i_object)
506 return;
507
508 for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
509 {
510 if (!itr->GetSource()->InSamePhase(i_phaseMask))
511 continue;
512
513 if (i_check(itr->GetSource()))
514 {
515 i_object = itr->GetSource();
516 return;
517 }
518 }
519}
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