diff options
Diffstat (limited to 'src/game.h')
-rw-r--r-- | src/game.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/game.h b/src/game.h index 9340c65..72dd337 100644 --- a/src/game.h +++ b/src/game.h | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <memory> | 8 | #include <memory> |
9 | #include <map> | 9 | #include <map> |
10 | #include <set> | 10 | #include <set> |
11 | #include <random> | ||
11 | #include "sprite.h" | 12 | #include "sprite.h" |
12 | #include "map.h" | 13 | #include "map.h" |
13 | #include "consts.h" | 14 | #include "consts.h" |
@@ -20,7 +21,7 @@ class Renderer; | |||
20 | class Game { | 21 | class Game { |
21 | public: | 22 | public: |
22 | 23 | ||
23 | explicit Game(Renderer& renderer) : font_("../res/font.txt", renderer) {} | 24 | Game(Renderer& renderer, std::mt19937& rng) : font_("../res/font.txt", renderer), rng_(&rng) {} |
24 | 25 | ||
25 | Mixer& getMixer() { return mixer_; } | 26 | Mixer& getMixer() { return mixer_; } |
26 | 27 | ||
@@ -83,6 +84,8 @@ public: | |||
83 | 84 | ||
84 | const Font& getFont() const { return font_; } | 85 | const Font& getFont() const { return font_; } |
85 | 86 | ||
87 | std::mt19937& getRng() { return *rng_; } | ||
88 | |||
86 | private: | 89 | private: |
87 | 90 | ||
88 | Mixer mixer_; | 91 | Mixer mixer_; |
@@ -97,6 +100,7 @@ private: | |||
97 | std::map<std::string, int> spritesByAlias_; | 100 | std::map<std::string, int> spritesByAlias_; |
98 | std::unique_ptr<Map> map_; | 101 | std::unique_ptr<Map> map_; |
99 | Font font_; | 102 | Font font_; |
103 | std::mt19937* rng_; | ||
100 | }; | 104 | }; |
101 | 105 | ||
102 | #endif /* end of include guard: GAME_H_E6F1396E */ | 106 | #endif /* end of include guard: GAME_H_E6F1396E */ |