-
Notifications
You must be signed in to change notification settings - Fork 178
/
Global.h
57 lines (46 loc) · 1.24 KB
/
Global.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#pragma once
#include <memory>
namespace UAlbertaBot
{
class MapTools;
class BaseLocationManager;
class InformationManager;
class StrategyManager;
class WorkerManager;
class ProductionManager;
class ScoutManager;
class Global
{
MapTools * m_mapTools = nullptr;
BaseLocationManager * m_baseLocationManager = nullptr;
InformationManager * m_informationManager = nullptr;
StrategyManager * m_strategyManager = nullptr;
WorkerManager * m_workerManager = nullptr;
ProductionManager * m_productionManager = nullptr;
ScoutManager * m_scoutManager = nullptr;
template <class T>
void reset(T *& ptr)
{
delete ptr;
ptr = nullptr;
}
template <class T>
static T * get(T *& ptr)
{
if (ptr == nullptr) { ptr = new T(); }
return ptr;
}
Global();
static Global & Instance();
void init();
public:
static void GameStart();
static MapTools & Map();
static BaseLocationManager & Bases();
static InformationManager & Info();
static StrategyManager & Strategy();
static WorkerManager & Workers();
static ProductionManager & Production();
static ScoutManager & Scout();
};
}