aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Grids/Notifiers
diff options
context:
space:
mode:
authorTraesh <Traesh@users.noreply.github.com>2017-05-14 11:40:55 +0200
committerjoschiwald <joschiwald.trinity@gmail.com>2017-05-14 11:40:55 +0200
commitc73ce93f4cf84667d23c2ec7e425f40a845eaf4f (patch)
tree255a3af04144a58e3156491bffd1aa743fb06bfa /src/server/game/Grids/Notifiers
parent3e18fcb8fd4ac8e9700f10eb3b6a1292c0f8beb8 (diff)
Core/Entities : Basic Conversation Implementation (#18010)
Diffstat (limited to 'src/server/game/Grids/Notifiers')
-rw-r--r--src/server/game/Grids/Notifiers/GridNotifiers.cpp2
-rw-r--r--src/server/game/Grids/Notifiers/GridNotifiers.h14
-rw-r--r--src/server/game/Grids/Notifiers/GridNotifiersImpl.h50
3 files changed, 65 insertions, 1 deletions
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.cpp b/src/server/game/Grids/Notifiers/GridNotifiers.cpp
index ebf94bbbc5c..3892db055ec 100644
--- a/src/server/game/Grids/Notifiers/GridNotifiers.cpp
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.cpp
@@ -372,4 +372,4 @@ template void ObjectUpdater::Visit<Creature>(CreatureMapType&);
template void ObjectUpdater::Visit<GameObject>(GameObjectMapType&);
template void ObjectUpdater::Visit<DynamicObject>(DynamicObjectMapType&);
template void ObjectUpdater::Visit<AreaTrigger>(AreaTriggerMapType &);
-
+template void ObjectUpdater::Visit<Conversation>(ConversationMapType &);
diff --git a/src/server/game/Grids/Notifiers/GridNotifiers.h b/src/server/game/Grids/Notifiers/GridNotifiers.h
index ce1e81468ab..35bf4942af2 100644
--- a/src/server/game/Grids/Notifiers/GridNotifiers.h
+++ b/src/server/game/Grids/Notifiers/GridNotifiers.h
@@ -26,6 +26,7 @@
#include "Corpse.h"
#include "Object.h"
#include "AreaTrigger.h"
+#include "Conversation.h"
#include "DynamicObject.h"
#include "GameObject.h"
#include "Player.h"
@@ -121,6 +122,7 @@ namespace Trinity
void Visit(DynamicObjectMapType &m) { updateObjects<DynamicObject>(m); }
void Visit(CorpseMapType &m) { updateObjects<Corpse>(m); }
void Visit(AreaTriggerMapType &m) { updateObjects<AreaTrigger>(m); }
+ void Visit(ConversationMapType &m) { updateObjects<Conversation>(m); }
};
struct TC_GAME_API MessageDistDeliverer
@@ -189,6 +191,7 @@ namespace Trinity
void Visit(CorpseMapType &m);
void Visit(DynamicObjectMapType &m);
void Visit(AreaTriggerMapType &m);
+ void Visit(ConversationMapType &m);
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
};
@@ -210,6 +213,7 @@ namespace Trinity
void Visit(CorpseMapType &m);
void Visit(DynamicObjectMapType &m);
void Visit(AreaTriggerMapType &m);
+ void Visit(ConversationMapType &m);
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
};
@@ -231,6 +235,7 @@ namespace Trinity
void Visit(GameObjectMapType &m);
void Visit(DynamicObjectMapType &m);
void Visit(AreaTriggerMapType &m);
+ void Visit(ConversationMapType &m);
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
};
@@ -298,6 +303,15 @@ namespace Trinity
i_do(itr->GetSource());
}
+ void Visit(ConversationMapType &m)
+ {
+ if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CONVERSATION))
+ return;
+ for (ConversationMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
+ if (itr->GetSource()->IsInPhase(_searcher))
+ i_do(itr->GetSource());
+ }
+
template<class NOT_INTERESTED> void Visit(GridRefManager<NOT_INTERESTED> &) { }
};
diff --git a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h
index 0ab703caade..68a1c17bdb3 100644
--- a/src/server/game/Grids/Notifiers/GridNotifiersImpl.h
+++ b/src/server/game/Grids/Notifiers/GridNotifiersImpl.h
@@ -181,6 +181,29 @@ void Trinity::WorldObjectSearcher<Check>::Visit(AreaTriggerMapType &m)
}
template<class Check>
+void Trinity::WorldObjectSearcher<Check>::Visit(ConversationMapType &m)
+{
+ if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CONVERSATION))
+ return;
+
+ // already found
+ if (i_object)
+ return;
+
+ for (ConversationMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
+ {
+ if (!itr->GetSource()->IsInPhase(_searcher))
+ continue;
+
+ if (i_check(itr->GetSource()))
+ {
+ i_object = itr->GetSource();
+ return;
+ }
+ }
+}
+
+template<class Check>
void Trinity::WorldObjectLastSearcher<Check>::Visit(GameObjectMapType &m)
{
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_GAMEOBJECT))
@@ -277,6 +300,22 @@ void Trinity::WorldObjectLastSearcher<Check>::Visit(AreaTriggerMapType &m)
}
template<class Check>
+void Trinity::WorldObjectLastSearcher<Check>::Visit(ConversationMapType &m)
+{
+ if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CONVERSATION))
+ return;
+
+ for (ConversationMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
+ {
+ if (!itr->GetSource()->IsInPhase(_searcher))
+ continue;
+
+ if (i_check(itr->GetSource()))
+ i_object = itr->GetSource();
+ }
+}
+
+template<class Check>
void Trinity::WorldObjectListSearcher<Check>::Visit(PlayerMapType &m)
{
if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_PLAYER))
@@ -342,6 +381,17 @@ void Trinity::WorldObjectListSearcher<Check>::Visit(AreaTriggerMapType &m)
i_objects.push_back(itr->GetSource());
}
+template<class Check>
+void Trinity::WorldObjectListSearcher<Check>::Visit(ConversationMapType &m)
+{
+ if (!(i_mapTypeMask & GRID_MAP_TYPE_MASK_CONVERSATION))
+ return;
+
+ for (ConversationMapType::iterator itr = m.begin(); itr != m.end(); ++itr)
+ if (i_check(itr->GetSource()))
+ i_objects.push_back(itr->GetSource());
+}
+
// Gameobject searchers
template<class Check>