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

@@ -24,6 +24,12 @@
#endif
#include <time.h>
GameEventMgr* GameEventMgr::instance()
{
static GameEventMgr instance;
return &instance;
}
bool GameEventMgr::CheckOneGameEvent(uint16 entry) const
{
switch (mGameEvent[entry].state)

View File

@@ -9,8 +9,6 @@
#include "Common.h"
#include "SharedDefines.h"
#include "Define.h"
#include <ace/Singleton.h>
#define max_ge_check_delay DAY // 1 day in seconds
@@ -83,13 +81,13 @@ class Quest;
class GameEventMgr
{
friend class ACE_Singleton<GameEventMgr, ACE_Null_Mutex>;
private:
GameEventMgr();
~GameEventMgr() {};
public:
static GameEventMgr* instance();
typedef std::set<uint16> ActiveEvents;
typedef std::vector<GameEventData> GameEventDataMap;
ActiveEvents const& GetActiveEventList() const { return m_ActiveEvents; }
@@ -169,7 +167,7 @@ class GameEventMgr
std::set<uint32> modifiedHolidays;
};
#define sGameEventMgr ACE_Singleton<GameEventMgr, ACE_Null_Mutex>::instance()
#define sGameEventMgr GameEventMgr::instance()
bool IsHolidayActive(HolidayIds id);
bool IsEventActive(uint16 event_id);