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

#include "GridNotifiers.h"

Public Member Functions

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

Public Attributes

uint32 i_phaseMask
 
Unit *& i_object
 
Check & i_check
 

Detailed Description

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

Constructor & Destructor Documentation

◆ UnitLastSearcher()

template<class Check >
Acore::UnitLastSearcher< Check >::UnitLastSearcher ( WorldObject const *  searcher,
Unit *&  result,
Check &  check 
)
inline
409 : i_phaseMask(searcher->GetPhaseMask()), i_object(result), i_check(check) {}
Check & i_check
Definition: GridNotifiers.h:406
Unit *& i_object
Definition: GridNotifiers.h:405
uint32 i_phaseMask
Definition: GridNotifiers.h:404

Member Function Documentation

◆ Visit() [1/3]

template<class Check >
void Acore::UnitLastSearcher< Check >::Visit ( CreatureMapType m)
391{
392 for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
393 {
394 if (!itr->GetSource()->InSamePhase(i_phaseMask))
395 continue;
396
397 if (i_check(itr->GetSource()))
398 i_object = itr->GetSource();
399 }
400}
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/3]

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

◆ Visit() [3/3]

template<class Check >
void Acore::UnitLastSearcher< Check >::Visit ( PlayerMapType m)
404{
405 for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
406 {
407 if (!itr->GetSource()->InSamePhase(i_phaseMask))
408 continue;
409
410 if (i_check(itr->GetSource()))
411 i_object = itr->GetSource();
412 }
413}

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

Member Data Documentation

◆ i_check

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

◆ i_object

template<class Check >
Unit*& Acore::UnitLastSearcher< Check >::i_object

◆ i_phaseMask

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