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

@@ -196,6 +196,12 @@ SocialMgr::~SocialMgr()
{
}
SocialMgr* SocialMgr::instance()
{
static SocialMgr instance;
return &instance;
}
void SocialMgr::GetFriendInfo(Player* player, uint32 friendGUID, FriendInfo &friendInfo)
{
if (!player)

View File

@@ -7,9 +7,8 @@
#ifndef __ACORE_SOCIALMGR_H
#define __ACORE_SOCIALMGR_H
#include <ace/Singleton.h>
#include "DatabaseEnv.h"
#include "Common.h"
#include "DatabaseEnv.h"
class SocialMgr;
class PlayerSocial;
@@ -112,13 +111,13 @@ class PlayerSocial
class SocialMgr
{
friend class ACE_Singleton<SocialMgr, ACE_Null_Mutex>;
private:
SocialMgr();
~SocialMgr();
public:
static SocialMgr* instance();
// Misc
void RemovePlayerSocial(uint32 guid) { m_socialMap.erase(guid); }
@@ -133,6 +132,6 @@ class SocialMgr
SocialMap m_socialMap;
};
#define sSocialMgr ACE_Singleton<SocialMgr, ACE_Null_Mutex>::instance()
#endif
#define sSocialMgr SocialMgr::instance()
#endif