-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTCScene.h
More file actions
73 lines (53 loc) · 1.36 KB
/
TCScene.h
File metadata and controls
73 lines (53 loc) · 1.36 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef TCScene_h
#define TCScene_h
#include <iostream>
#include <list>
#include <json/json.h>
namespace Touched {
class TCScene {
private:
std::string name;
Json::Value value;
bool need_load;
bool need_reload;
bool pre_load;
bool pre_unload;
bool is_reload;
void Update(bool _for_load);
public:
bool loaded;
TCScene(const std::string _name);
virtual ~TCScene();
std::string GetName();
bool GetIsLoadedScene();
virtual void PreLoad(const Json::Value _value, bool _is_reload) = 0;
virtual bool ReadyLoad(bool _is_reload) = 0;
virtual void Load(const Json::Value _value, bool _is_reload) = 0;
virtual void PreUnload() = 0;
virtual bool ReadyUnload() = 0;
virtual void Unload() = 0;
const Json::Value GetValue();
friend class TCSceneManager;
};
class TCSceneManager {
private:
std::list<TCScene*> scene_list;
std::list<Json::Value> value_list;
public:
static TCSceneManager* Share();
TCScene* GetScene(const std::string _name);
std::string GetCurrentSceneName();
TCScene* GetCurrentScene();
void Link(const Json::Value _value);
bool Back();
void Reload();
void ClearHistory();
Json::Value get_pre_value();
void set_pre_value(Json::Value _value);
Json::Value get_cur_value();
void set_cur_value(Json::Value _value);
void Update();
friend class TCScene;
};
}
#endif