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
412 : i_phaseMask(searcher->GetPhaseMask()), i_object(result), i_check(check) {}
Check & i_check
Definition: GridNotifiers.h:409
Unit *& i_object
Definition: GridNotifiers.h:408
uint32 i_phaseMask
Definition: GridNotifiers.h:407

Member Function Documentation

◆ Visit() [1/3]

template<class Check >
void Acore::UnitLastSearcher< Check >::Visit ( CreatureMapType m)
387{
388 for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
389 {
390 if (!itr->GetSource()->InSamePhase(i_phaseMask))
391 continue;
392
393 if (i_check(itr->GetSource()))
394 i_object = itr->GetSource();
395 }
396}
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
417{}

◆ Visit() [3/3]

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

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