From 9113afb868f6c1da5911437d3ddabdcf169cbec2 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Mon, 6 Apr 2009 00:00:54 +0200 Subject: Use a namespace to keep apart implementations of network handlers Since we'll have three "InventoryHandler" classes, etc. this shows an example of how we can compile with all of them at the same time using namespaces. We'll have: Net::InventoryHandler - the interface EAthena::InventoryHandler - the eAthena implementation TmwServ::InventoryHandler - the tmwserv implementation Maybe we'll find a better way later, but for now this works. I'm not convinced yet that using namespaces is better than just using longer class names like EAthenaInventoryHandler. --- src/net/ea/inventoryhandler.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/net/ea/inventoryhandler.h') diff --git a/src/net/ea/inventoryhandler.h b/src/net/ea/inventoryhandler.h index bfebc9b3..391c13f4 100644 --- a/src/net/ea/inventoryhandler.h +++ b/src/net/ea/inventoryhandler.h @@ -26,6 +26,8 @@ #include "net/messagehandler.h" #include "net/net.h" +namespace EAthena { + class InventoryHandler : public MessageHandler, public Net::InventoryHandler { public: @@ -51,6 +53,6 @@ class InventoryHandler : public MessageHandler, public Net::InventoryHandler StorageType destination); }; -extern InventoryHandler *inventoryHandler; +} // namespace EAthena #endif // NET_EA_INVENTORYHANDLER_H -- cgit v1.2.3-60-g2f50