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/world.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/world.h')
| -rw-r--r-- | src/world.h | 41 |
1 files changed, 41 insertions, 0 deletions
| diff --git a/src/world.h b/src/world.h new file mode 100644 index 0000000..b88adf4 --- /dev/null +++ b/src/world.h | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | #ifndef WORLD_H_153C698B | ||
| 2 | #define WORLD_H_153C698B | ||
| 3 | |||
| 4 | #include <map> | ||
| 5 | #include <string> | ||
| 6 | #include "map.h" | ||
| 7 | |||
| 8 | class World { | ||
| 9 | public: | ||
| 10 | |||
| 11 | explicit World(std::string filename); | ||
| 12 | |||
| 13 | inline const Map& getMap(size_t id) const | ||
| 14 | { | ||
| 15 | return maps_.at(id); | ||
| 16 | } | ||
| 17 | |||
| 18 | inline size_t getStartingMapId() const | ||
| 19 | { | ||
| 20 | return startMap_; | ||
| 21 | } | ||
| 22 | |||
| 23 | inline int getStartingX() const | ||
| 24 | { | ||
| 25 | return startX_; | ||
| 26 | } | ||
| 27 | |||
| 28 | inline int getStartingY() const | ||
| 29 | { | ||
| 30 | return startY_; | ||
| 31 | } | ||
| 32 | |||
| 33 | private: | ||
| 34 | |||
| 35 | std::map<size_t, Map> maps_; | ||
| 36 | size_t startMap_; | ||
| 37 | int startX_; | ||
| 38 | int startY_; | ||
| 39 | }; | ||
| 40 | |||
| 41 | #endif /* end of include guard: WORLD_H_153C698B */ | ||
