summary refs log tree commit diff stats
path: root/src/game.h
diff options
context:
space:
mode:
authorKelly Rauchenberger <fefferburbia@gmail.com>2021-02-20 13:04:41 -0500
committerKelly Rauchenberger <fefferburbia@gmail.com>2021-02-20 13:04:41 -0500
commit996076cf151a27a7a8d278aa4d15b28cfb196c46 (patch)
tree96a2fdcf3fd5a22394313d140cacc0257a821543 /src/game.h
parentee802c01d3008e6019bc55a02fcc2e6d68b288d1 (diff)
downloadtanetane-996076cf151a27a7a8d278aa4d15b28cfb196c46.tar.gz
tanetane-996076cf151a27a7a8d278aa4d15b28cfb196c46.tar.bz2
tanetane-996076cf151a27a7a8d278aa4d15b28cfb196c46.zip
Added a randomly wandering Ionia to the map
Diffstat (limited to 'src/game.h')
-rw-r--r--src/game.h6
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;
20class Game { 21class Game {
21public: 22public:
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
86private: 89private:
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 */