diff options
| author | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-02-11 12:34:52 -0500 |
|---|---|---|
| committer | Kelly Rauchenberger <fefferburbia@gmail.com> | 2018-02-11 12:34:52 -0500 |
| commit | 77be863f4f15d2481a64e4e8dadb4060a6e4e590 (patch) | |
| tree | ca571702d2148a75b5b847e77d26270257f54ebc /src/map.h | |
| parent | 1400ade977e13e3b535d3c2fddb6e15de3c9b5a5 (diff) | |
| download | therapy-77be863f4f15d2481a64e4e8dadb4060a6e4e590.tar.gz therapy-77be863f4f15d2481a64e4e8dadb4060a6e4e590.tar.bz2 therapy-77be863f4f15d2481a64e4e8dadb4060a6e4e590.zip | |
Implemented map rendering and basic collision
Only wall and platform collision currently works, and map edges are not currently implemented.
Diffstat (limited to 'src/map.h')
| -rw-r--r-- | src/map.h | 45 |
1 files changed, 45 insertions, 0 deletions
| diff --git a/src/map.h b/src/map.h new file mode 100644 index 0000000..9177870 --- /dev/null +++ b/src/map.h | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | #ifndef MAP_H_74055FC0 | ||
| 2 | #define MAP_H_74055FC0 | ||
| 3 | |||
| 4 | #include <vector> | ||
| 5 | #include <string> | ||
| 6 | #include <list> | ||
| 7 | #include <stdexcept> | ||
| 8 | #include <map> | ||
| 9 | |||
| 10 | class Map { | ||
| 11 | public: | ||
| 12 | |||
| 13 | Map( | ||
| 14 | int id, | ||
| 15 | std::vector<int> tiles, | ||
| 16 | std::string title) : | ||
| 17 | id_(id), | ||
| 18 | tiles_(std::move(tiles)), | ||
| 19 | title_(std::move(title)) | ||
| 20 | { | ||
| 21 | } | ||
| 22 | |||
| 23 | inline size_t getId() const | ||
| 24 | { | ||
| 25 | return id_; | ||
| 26 | } | ||
| 27 | |||
| 28 | inline const std::vector<int>& getTiles() const | ||
| 29 | { | ||
| 30 | return tiles_; | ||
| 31 | } | ||
| 32 | |||
| 33 | inline const std::string& getTitle() const | ||
| 34 | { | ||
| 35 | return title_; | ||
| 36 | } | ||
| 37 | |||
| 38 | private: | ||
| 39 | |||
| 40 | int id_; | ||
| 41 | std::vector<int> tiles_; | ||
| 42 | std::string title_; | ||
| 43 | }; | ||
| 44 | |||
| 45 | #endif /* end of include guard: MAP_H_74055FC0 */ | ||
