diff options
Diffstat (limited to 'src/world.h')
| -rw-r--r-- | src/world.h | 48 |
1 files changed, 34 insertions, 14 deletions
| diff --git a/src/world.h b/src/world.h index f566487..b88adf4 100644 --- a/src/world.h +++ b/src/world.h | |||
| @@ -1,21 +1,41 @@ | |||
| 1 | #ifndef WORLD_H | 1 | #ifndef WORLD_H_153C698B |
| 2 | #define WORLD_H | 2 | #define WORLD_H_153C698B |
| 3 | 3 | ||
| 4 | #include <map> | 4 | #include <map> |
| 5 | #include <string> | ||
| 5 | #include "map.h" | 6 | #include "map.h" |
| 6 | 7 | ||
| 7 | class World { | 8 | class World { |
| 8 | public: | 9 | public: |
| 9 | World(const char* filename); | 10 | |
| 10 | const Map& getMap(int id) const; | 11 | explicit World(std::string filename); |
| 11 | const Map& getStartingMap() const; | 12 | |
| 12 | std::pair<int, int> getStartingPosition() const; | 13 | inline const Map& getMap(size_t id) const |
| 13 | 14 | { | |
| 14 | private: | 15 | return maps_.at(id); |
| 15 | std::map<int, Map> maps; | 16 | } |
| 16 | int startMap; | 17 | |
| 17 | int startX; | 18 | inline size_t getStartingMapId() const |
| 18 | int startY; | 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_; | ||
| 19 | }; | 39 | }; |
| 20 | 40 | ||
| 21 | #endif /* end of include guard: WORLD_H */ | 41 | #endif /* end of include guard: WORLD_H_153C698B */ |
