mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-19 03:45:43 +00:00
feat(Core/Misc): remove and replace ACE_Singleton (#2418)
This commit is contained in:
@@ -27,6 +27,12 @@ WaypointMgr::~WaypointMgr()
|
||||
_waypointStore.clear();
|
||||
}
|
||||
|
||||
WaypointMgr* WaypointMgr::instance()
|
||||
{
|
||||
static WaypointMgr instance;
|
||||
return &instance;
|
||||
}
|
||||
|
||||
void WaypointMgr::Load()
|
||||
{
|
||||
uint32 oldMSTime = getMSTime();
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
#ifndef ACORE_WAYPOINTMANAGER_H
|
||||
#define ACORE_WAYPOINTMANAGER_H
|
||||
|
||||
#include <ace/Singleton.h>
|
||||
#include <ace/Null_Mutex.h>
|
||||
#include "Common.h"
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
|
||||
enum WaypointMoveType
|
||||
{
|
||||
@@ -36,9 +36,9 @@ typedef std::unordered_map<uint32, WaypointPath> WaypointPathContainer;
|
||||
|
||||
class WaypointMgr
|
||||
{
|
||||
friend class ACE_Singleton<WaypointMgr, ACE_Null_Mutex>;
|
||||
|
||||
public:
|
||||
static WaypointMgr* instance();
|
||||
|
||||
// Attempts to reload a single path from database
|
||||
void ReloadPath(uint32 id);
|
||||
|
||||
@@ -52,17 +52,16 @@ class WaypointMgr
|
||||
if (itr != _waypointStore.end())
|
||||
return &itr->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
// Only allow instantiation from ACE_Singleton
|
||||
WaypointMgr();
|
||||
~WaypointMgr();
|
||||
|
||||
WaypointPathContainer _waypointStore;
|
||||
};
|
||||
|
||||
#define sWaypointMgr ACE_Singleton<WaypointMgr, ACE_Null_Mutex>::instance()
|
||||
#define sWaypointMgr WaypointMgr::instance()
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user