diff options
| author | leak <leak@bitmx.net> | 2014-07-01 00:54:09 +0200 |
|---|---|---|
| committer | leak <leak@bitmx.net> | 2014-07-01 00:54:09 +0200 |
| commit | 029bad6698df6ac9556fe308342e616f4a7a8cc7 (patch) | |
| tree | 01142dad7e748aba7799b9c296ccc4cf11db886f /src/server/game/AI/SmartScripts | |
| parent | d39a013b6b979a5158bf86c37a197cb902b2c2f9 (diff) | |
Replaced all remaining ACE based Singletons
Replaced ACE base AutoPtr class with shared_ptr
Note: worldserver currently broken due to MapUpdater threading failure (ACE ofc, what else could it be)
Diffstat (limited to 'src/server/game/AI/SmartScripts')
| -rw-r--r-- | src/server/game/AI/SmartScripts/SmartScriptMgr.h | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScriptMgr.h b/src/server/game/AI/SmartScripts/SmartScriptMgr.h index 3d14b8f69e9..0380ec8bae9 100644 --- a/src/server/game/AI/SmartScripts/SmartScriptMgr.h +++ b/src/server/game/AI/SmartScripts/SmartScriptMgr.h @@ -1396,11 +1396,17 @@ typedef std::unordered_map<uint32, ObjectGuidList*> ObjectListMap; class SmartWaypointMgr { - friend class ACE_Singleton<SmartWaypointMgr, ACE_Null_Mutex>; - SmartWaypointMgr() { } - public: + private: + SmartWaypointMgr() { } ~SmartWaypointMgr(); + public: + static SmartWaypointMgr* instance() + { + static SmartWaypointMgr* instance = new SmartWaypointMgr(); + return instance; + } + void LoadFromDB(); WPPath* GetPath(uint32 id) @@ -1426,11 +1432,17 @@ typedef std::pair<CacheSpellContainer::const_iterator, CacheSpellContainer::cons class SmartAIMgr { - friend class ACE_Singleton<SmartAIMgr, ACE_Null_Mutex>; - SmartAIMgr() { } - public: + private: + SmartAIMgr() { } ~SmartAIMgr() { } + public: + static SmartAIMgr* instance() + { + static SmartAIMgr* instance = new SmartAIMgr(); + return instance; + } + void LoadSmartAIFromDB(); SmartAIEventList GetScript(int32 entry, SmartScriptType type) @@ -1598,6 +1610,6 @@ class SmartAIMgr CacheSpellContainer KillCreditSpellStore; }; -#define sSmartScriptMgr ACE_Singleton<SmartAIMgr, ACE_Null_Mutex>::instance() -#define sSmartWaypointMgr ACE_Singleton<SmartWaypointMgr, ACE_Null_Mutex>::instance() +#define sSmartScriptMgr SmartAIMgr::instance() +#define sSmartWaypointMgr SmartWaypointMgr::instance() #endif |
