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
@@ -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