TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Trinity::UnitSearcher< Check > Struct Template Reference

#include <GridNotifiers.h>

Public Member Functions

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

Public Attributes

WorldObject const_searcher
 
Unit *& i_object
 
Check & i_check
 

Constructor & Destructor Documentation

template<class Check>
Trinity::UnitSearcher< Check >::UnitSearcher ( WorldObject const searcher,
Unit *&  result,
Check &  check 
)
inline
383  : _searcher(searcher), i_object(result), i_check(check) { }
Unit *& i_object
Definition: GridNotifiers.h:379
Check & i_check
Definition: GridNotifiers.h:380
T check(T value)
Definition: format.h:305
WorldObject const * _searcher
Definition: GridNotifiers.h:378

Member Function Documentation

template<class Check >
void Trinity::UnitSearcher< Check >::Visit ( CreatureMapType m)
393 {
394  // already found
395  if (i_object)
396  return;
397 
398  for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
399  {
400  if (!itr->GetSource()->IsInPhase(_searcher))
401  continue;
402 
403  if (i_check(itr->GetSource()))
404  {
405  i_object = itr->GetSource();
406  return;
407  }
408  }
409 }
Unit *& i_object
Definition: GridNotifiers.h:379
Definition: LinkedList.h:141
iterator begin()
Definition: GridRefManager.h:36
Check & i_check
Definition: GridNotifiers.h:380
iterator end()
Definition: GridRefManager.h:37
WorldObject const * _searcher
Definition: GridNotifiers.h:378

+ Here is the call graph for this function:

template<class Check >
void Trinity::UnitSearcher< Check >::Visit ( PlayerMapType m)
413 {
414  // already found
415  if (i_object)
416  return;
417 
418  for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
419  {
420  if (!itr->GetSource()->IsInPhase(_searcher))
421  continue;
422 
423  if (i_check(itr->GetSource()))
424  {
425  i_object = itr->GetSource();
426  return;
427  }
428  }
429 }
Unit *& i_object
Definition: GridNotifiers.h:379
Definition: LinkedList.h:141
iterator begin()
Definition: GridRefManager.h:36
Check & i_check
Definition: GridNotifiers.h:380
iterator end()
Definition: GridRefManager.h:37
WorldObject const * _searcher
Definition: GridNotifiers.h:378

+ Here is the call graph for this function:

template<class Check>
template<class NOT_INTERESTED >
void Trinity::UnitSearcher< Check >::Visit ( GridRefManager< NOT_INTERESTED > &  )
inline
388 { }

Member Data Documentation

template<class Check>
WorldObject const* Trinity::UnitSearcher< Check >::_searcher
template<class Check>
Check& Trinity::UnitSearcher< Check >::i_check
template<class Check>
Unit* & Trinity::UnitSearcher< Check >::i_object

The documentation for this struct was generated from the following files: