aboutsummaryrefslogtreecommitdiff
path: root/src/game/GridNotifiers.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/GridNotifiers.h')
-rw-r--r--src/game/GridNotifiers.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/game/GridNotifiers.h b/src/game/GridNotifiers.h
index b45f7f6d675..2295f72e4c9 100644
--- a/src/game/GridNotifiers.h
+++ b/src/game/GridNotifiers.h
@@ -440,6 +440,25 @@ namespace Trinity
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) {}
};
+ template<class Do>
+ struct MANGOS_DLL_DECL CreatureWorker
+ {
+ uint32 i_phaseMask;
+ Do& i_do;
+
+ CreatureWorker(WorldObject const* searcher, Do& _do)
+ : i_phaseMask(searcher->GetPhaseMask()), i_do(_do) {}
+
+ void Visit(CreatureMapType &m)
+ {
+ for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+ if(itr->getSource()->InSamePhase(i_phaseMask))
+ i_do(itr->getSource());
+ }
+
+ template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) {}
+ };
+
// Player searchers
template<class Check>