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

#include "GridNotifiers.h"

Public Member Functions

 GameObjectSearcher (WorldObject const *searcher, GameObject *&result, Check &check)
 
void Visit (GameObjectMapType &m)
 
template<class NOT_INTERESTED >
void Visit (GridRefMgr< NOT_INTERESTED > &)
 

Public Attributes

uint32 i_phaseMask
 
GameObject *& i_object
 
Check & i_check
 

Detailed Description

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

Constructor & Destructor Documentation

◆ GameObjectSearcher()

template<class Check >
Acore::GameObjectSearcher< Check >::GameObjectSearcher ( WorldObject const *  searcher,
GameObject *&  result,
Check &  check 
)
inline
322 : i_phaseMask(searcher->GetPhaseMask()), i_object(result), i_check(check) {}
Check & i_check
Definition: GridNotifiers.h:319
uint32 i_phaseMask
Definition: GridNotifiers.h:317
GameObject *& i_object
Definition: GridNotifiers.h:318

Member Function Documentation

◆ Visit() [1/2]

template<class Check >
void Acore::GameObjectSearcher< Check >::Visit ( GameObjectMapType m)
307{
308 // already found
309 if (i_object)
310 return;
311
312 for (GameObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
313 {
314 if (!itr->GetSource()->InSamePhase(i_phaseMask))
315 continue;
316
317 if (i_check(itr->GetSource()))
318 {
319 i_object = itr->GetSource();
320 return;
321 }
322 }
323}
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::GameObjectSearcher< Check >::Visit ( GridRefMgr< NOT_INTERESTED > &  )
inline
326{}

Member Data Documentation

◆ i_check

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

◆ i_object

template<class Check >
GameObject*& Acore::GameObjectSearcher< Check >::i_object

◆ i_phaseMask

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