diff options
Diffstat (limited to 'src/model/Map.hpp')
-rw-r--r-- | src/model/Map.hpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/model/Map.hpp b/src/model/Map.hpp index 423c91d..77a67be 100644 --- a/src/model/Map.hpp +++ b/src/model/Map.hpp @@ -27,7 +27,6 @@ #pragma once #include <cstdint> -#include <deque> #include <memory> #include <stdexcept> #include <vector> @@ -44,14 +43,14 @@ private: std::vector<std::string> tileset; size_t width, height; - std::vector<std::unique_ptr<uint32_t[]>> tiles; + std::vector<std::vector<uint32_t>> tiles; + std::vector<Entity> entities; - std::shared_ptr<Entity> playerEntity; - mutable std::deque<std::shared_ptr<Entity>> entities; - - Map(size_t width0, size_t height0) + Map(size_t width0, size_t height0, size_t layers) : width(width0), height(height0) { + for (size_t i = 0; i < layers; i++) + tiles.emplace_back(width*height); } public: @@ -63,12 +62,12 @@ public: return tileset; } - std::deque<std::shared_ptr<Entity>> & getEntities() const { + std::vector<Entity> & getEntities() { return entities; } - const std::shared_ptr<Entity> & getPlayerEntity() const { - return playerEntity; + const std::vector<Entity> & getEntities() const { + return entities; } size_t getWidth() const { |