feat(Core/Misc): remove and replace ACE_Singleton (#2418)

This commit is contained in:
Kargatum
2019-12-21 00:29:29 +07:00
committed by GitHub
parent 16b45bf334
commit 4a8f1de538
88 changed files with 486 additions and 250 deletions

View File

@@ -16,6 +16,12 @@ LootItemStorage::~LootItemStorage()
{
}
LootItemStorage* LootItemStorage::instance()
{
static LootItemStorage instance;
return &instance;
}
void LootItemStorage::LoadStorageFromDB()
{
uint32 oldMSTime = getMSTime();

View File

@@ -6,12 +6,10 @@ Xinef
#define ACORE_LOOTITEMSTORAGE_H
#include "Common.h"
#include <map>
#include <list>
#include "ace/Singleton.h"
#include "LootMgr.h"
#include "Item.h"
#include <map>
#include <list>
struct StoredLootItem
{
@@ -30,13 +28,13 @@ typedef std::unordered_map<uint32, StoredLootItemList> LootItemContainer;
class LootItemStorage
{
friend class ACE_Singleton<LootItemStorage, ACE_Thread_Mutex>;
private:
LootItemStorage();
~LootItemStorage();
public:
static LootItemStorage* instance();
void LoadStorageFromDB();
void RemoveEntryFromDB(uint32 containerId, uint32 itemid, uint32 count);
@@ -51,5 +49,6 @@ class LootItemStorage
LootItemContainer lootItemStore;
};
#define sLootItemStorage ACE_Singleton<LootItemStorage, ACE_Thread_Mutex>::instance()
#define sLootItemStorage LootItemStorage::instance()
#endif