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

#include "GridNotifiers.h"

Public Member Functions

 WorldObjectSearcher (WorldObject const *searcher, WorldObject *&result, Check &check, uint32 mapTypeMask=GRID_MAP_TYPE_MASK_ALL)
 
void Visit (GameObjectMapType &m)
 
void Visit (PlayerMapType &m)
 
void Visit (CreatureMapType &m)
 
void Visit (CorpseMapType &m)
 
void Visit (DynamicObjectMapType &m)
 
template<class NOT_INTERESTED >
void Visit (GridRefMgr< NOT_INTERESTED > &)
 

Public Attributes

uint32 i_mapTypeMask
 
uint32 i_phaseMask
 
WorldObject *& i_object
 
Check & i_check
 

Detailed Description

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

Constructor & Destructor Documentation

◆ WorldObjectSearcher()

template<class Check >
Acore::WorldObjectSearcher< Check >::WorldObjectSearcher ( WorldObject const *  searcher,
WorldObject *&  result,
Check &  check,
uint32  mapTypeMask = GRID_MAP_TYPE_MASK_ALL 
)
inline
206 : i_mapTypeMask(mapTypeMask), i_phaseMask(searcher->GetPhaseMask()), i_object(result), i_check(check) {}
uint32 i_mapTypeMask
Definition: GridNotifiers.h:200
uint32 i_phaseMask
Definition: GridNotifiers.h:201
WorldObject *& i_object
Definition: GridNotifiers.h:202
Check & i_check
Definition: GridNotifiers.h:203

Member Function Documentation

◆ Visit() [1/6]

template<class Check >
void Acore::WorldObjectSearcher< Check >::Visit ( CorpseMapType m)
120{
122 return;
123
124 // already found
125 if (i_object)
126 return;
127
128 for (CorpseMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
129 {
130 if (!itr->GetSource()->InSamePhase(i_phaseMask))
131 continue;
132
133 if (i_check(itr->GetSource()))
134 {
135 i_object = itr->GetSource();
136 return;
137 }
138 }
139}
@ GRID_MAP_TYPE_MASK_CORPSE
Definition: GridDefines.h:68
Definition: LinkedList.h:139
iterator begin()
Definition: GridRefMgr.h:35
iterator end()
Definition: GridRefMgr.h:36

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

◆ Visit() [2/6]

template<class Check >
void Acore::WorldObjectSearcher< Check >::Visit ( CreatureMapType m)
97{
99 return;
100
101 // already found
102 if (i_object)
103 return;
104
105 for (CreatureMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
106 {
107 if (!itr->GetSource()->InSamePhase(i_phaseMask))
108 continue;
109
110 if (i_check(itr->GetSource()))
111 {
112 i_object = itr->GetSource();
113 return;
114 }
115 }
116}
@ GRID_MAP_TYPE_MASK_CREATURE
Definition: GridDefines.h:69

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

◆ Visit() [3/6]

template<class Check >
void Acore::WorldObjectSearcher< Check >::Visit ( DynamicObjectMapType m)
143{
145 return;
146
147 // already found
148 if (i_object)
149 return;
150
151 for (DynamicObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
152 {
153 if (!itr->GetSource()->InSamePhase(i_phaseMask))
154 continue;
155
156 if (i_check(itr->GetSource()))
157 {
158 i_object = itr->GetSource();
159 return;
160 }
161 }
162}
@ GRID_MAP_TYPE_MASK_DYNAMICOBJECT
Definition: GridDefines.h:70

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

◆ Visit() [4/6]

template<class Check >
void Acore::WorldObjectSearcher< Check >::Visit ( GameObjectMapType m)
51{
53 return;
54
55 // already found
56 if (i_object)
57 return;
58
59 for (GameObjectMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
60 {
61 if (!itr->GetSource()->InSamePhase(i_phaseMask))
62 continue;
63
64 if (i_check(itr->GetSource()))
65 {
66 i_object = itr->GetSource();
67 return;
68 }
69 }
70}
@ GRID_MAP_TYPE_MASK_GAMEOBJECT
Definition: GridDefines.h:71

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

◆ Visit() [5/6]

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

◆ Visit() [6/6]

template<class Check >
void Acore::WorldObjectSearcher< Check >::Visit ( PlayerMapType m)
74{
76 return;
77
78 // already found
79 if (i_object)
80 return;
81
82 for (PlayerMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
83 {
84 if (!itr->GetSource()->InSamePhase(i_phaseMask))
85 continue;
86
87 if (i_check(itr->GetSource()))
88 {
89 i_object = itr->GetSource();
90 return;
91 }
92 }
93}
@ GRID_MAP_TYPE_MASK_PLAYER
Definition: GridDefines.h:72

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

Member Data Documentation

◆ i_check

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

◆ i_mapTypeMask

template<class Check >
uint32 Acore::WorldObjectSearcher< Check >::i_mapTypeMask

◆ i_object

template<class Check >
WorldObject*& Acore::WorldObjectSearcher< Check >::i_object

◆ i_phaseMask

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