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

#include <GridNotifiers.h>

Public Member Functions

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

Public Attributes

WorldObject const_searcher
 
Creature *& i_object
 
Check & i_check
 

Constructor & Destructor Documentation

template<class Check>
Trinity::CreatureSearcher< Check >::CreatureSearcher ( WorldObject const searcher,
Creature *&  result,
Check &  check 
)
inline
435  : _searcher(searcher), i_object(result), i_check(check) { }
WorldObject const * _searcher
Definition: GridNotifiers.h:430
Check & i_check
Definition: GridNotifiers.h:432
T check(T value)
Definition: format.h:305
Creature *& i_object
Definition: GridNotifiers.h:431

Member Function Documentation

template<class Check >
void Trinity::CreatureSearcher< Check >::Visit ( CreatureMapType m)
479 {
480  // already found
481  if (i_object)
482  return;
483 
484  for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
485  {
486  if (!itr->GetSource()->IsInPhase(_searcher))
487  continue;
488 
489  if (i_check(itr->GetSource()))
490  {
491  i_object = itr->GetSource();
492  return;
493  }
494  }
495 }
WorldObject const * _searcher
Definition: GridNotifiers.h:430
Check & i_check
Definition: GridNotifiers.h:432
Definition: LinkedList.h:141
iterator begin()
Definition: GridRefManager.h:36
iterator end()
Definition: GridRefManager.h:37
Creature *& i_object
Definition: GridNotifiers.h:431

+ Here is the call graph for this function:

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

Member Data Documentation

template<class Check>
WorldObject const* Trinity::CreatureSearcher< Check >::_searcher
template<class Check>
Check& Trinity::CreatureSearcher< Check >::i_check
template<class Check>
Creature* & Trinity::CreatureSearcher< Check >::i_object

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