]> git.localhorst.tv Git - blank.git/blob - src/app/Environment.hpp
724db7072de75fa0aa3904ebd1f2c1332aa70ab9
[blank.git] / src / app / Environment.hpp
1 #ifndef BLANK_APP_ENVIRONMENT_HPP_
2 #define BLANK_APP_ENVIRONMENT_HPP_
3
4 #include "Assets.hpp"
5 #include "FrameCounter.hpp"
6 #include "MessageState.hpp"
7 #include "StateControl.hpp"
8 #include "../audio/Audio.hpp"
9 #include "../graphics/Viewport.hpp"
10 #include "../rand/GaloisLFSR.hpp"
11 #include "../ui/Keymap.hpp"
12
13 #include <string>
14
15
16 namespace blank {
17
18 class Window;
19
20 struct HeadlessEnvironment {
21
22         struct Config {
23                 std::string asset_path;
24                 std::string save_path;
25
26                 std::string GetWorldPath(
27                         const std::string &world_name
28                 ) const;
29                 std::string GetWorldPath(
30                         const std::string &world_name,
31                         const std::string &hostname
32                 ) const;
33         } config;
34
35         AssetLoader loader;
36
37         FrameCounter counter;
38
39         StateControl state;
40
41         GaloisLFSR rng;
42
43
44         explicit HeadlessEnvironment(const Config &);
45
46 };
47
48
49 struct Environment
50 : public HeadlessEnvironment {
51
52         Assets assets;
53
54         Audio audio;
55         Viewport viewport;
56         Window &window;
57
58         Keymap keymap;
59
60         MessageState msg_state;
61
62
63         Environment(Window &win, const Config &);
64
65         void ShowMessage(const char *);
66
67 };
68
69 }
70
71 #endif