mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 05:06:24 +00:00
feat(Core/Misc): remove and replace ACE_Singleton (#2418)
This commit is contained in:
@@ -17,6 +17,12 @@ FormationMgr::~FormationMgr()
|
||||
delete itr->second;
|
||||
}
|
||||
|
||||
FormationMgr* FormationMgr::instance()
|
||||
{
|
||||
static FormationMgr instance;
|
||||
return &instance;
|
||||
}
|
||||
|
||||
void FormationMgr::AddCreatureToGroup(uint32 groupId, Creature* member)
|
||||
{
|
||||
Map* map = member->FindMap();
|
||||
|
||||
@@ -28,10 +28,12 @@ typedef std::unordered_map<uint32/*memberDBGUID*/, FormationInfo*> CreatureGro
|
||||
|
||||
class FormationMgr
|
||||
{
|
||||
friend class ACE_Singleton<FormationMgr, ACE_Null_Mutex>;
|
||||
public:
|
||||
FormationMgr() { }
|
||||
~FormationMgr();
|
||||
|
||||
static FormationMgr* instance();
|
||||
|
||||
void AddCreatureToGroup(uint32 group_id, Creature* creature);
|
||||
void RemoveCreatureFromGroup(CreatureGroup* group, Creature* creature);
|
||||
void LoadCreatureFormations();
|
||||
@@ -69,6 +71,6 @@ class CreatureGroup
|
||||
bool m_Formed;
|
||||
};
|
||||
|
||||
#define sFormationMgr ACE_Singleton<FormationMgr, ACE_Null_Mutex>::instance()
|
||||
#define sFormationMgr FormationMgr::instance()
|
||||
|
||||
#endif
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user