diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-03 12:33:03 -0500 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2021-02-03 12:33:03 -0500 |
| commit | 683e22c419757744ce853c35d732f607ddb9af16 (patch) | |
| tree | bc31c1c08f19d270f70b27737d4f6944d30759b7 /src/game.h | |
| parent | 8d7ef2b2ae3ddff204f5934fe67c535d7f1345e9 (diff) | |
| download | tanetane-683e22c419757744ce853c35d732f607ddb9af16.tar.gz tanetane-683e22c419757744ce853c35d732f607ddb9af16.tar.bz2 tanetane-683e22c419757744ce853c35d732f607ddb9af16.zip | |
Added input system
Diffstat (limited to 'src/game.h')
| -rw-r--r-- | src/game.h | 17 |
1 files changed, 10 insertions, 7 deletions
| diff --git a/src/game.h b/src/game.h index f8e4b0d..36398bc 100644 --- a/src/game.h +++ b/src/game.h | |||
| @@ -10,17 +10,17 @@ | |||
| 10 | #include "map.h" | 10 | #include "map.h" |
| 11 | #include "consts.h" | 11 | #include "consts.h" |
| 12 | #include "system.h" | 12 | #include "system.h" |
| 13 | 13 | #include "mixer.h" | |
| 14 | struct Input { | ||
| 15 | bool left = false; | ||
| 16 | bool right = false; | ||
| 17 | bool up = false; | ||
| 18 | bool down = false; | ||
| 19 | }; | ||
| 20 | 14 | ||
| 21 | class Game { | 15 | class Game { |
| 22 | public: | 16 | public: |
| 23 | 17 | ||
| 18 | Mixer& getMixer() { return mixer_; } | ||
| 19 | |||
| 20 | bool shouldQuit() const { return shouldQuit_; } | ||
| 21 | |||
| 22 | void quit() { shouldQuit_ = true; } | ||
| 23 | |||
| 24 | template <typename T> | 24 | template <typename T> |
| 25 | void emplaceSystem() { | 25 | void emplaceSystem() { |
| 26 | systems_.push_back(std::make_unique<T>(*this)); | 26 | systems_.push_back(std::make_unique<T>(*this)); |
| @@ -70,6 +70,9 @@ public: | |||
| 70 | 70 | ||
| 71 | private: | 71 | private: |
| 72 | 72 | ||
| 73 | Mixer mixer_; | ||
| 74 | bool shouldQuit_ = false; | ||
| 75 | |||
| 73 | std::list<std::unique_ptr<System>> systems_; | 76 | std::list<std::unique_ptr<System>> systems_; |
| 74 | std::map<SystemKey, System*> systemByKey_; | 77 | std::map<SystemKey, System*> systemByKey_; |
| 75 | 78 | ||
