From 79c7edc335fc162e9d2ef9acc5cdf41fbd1bac76 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sat, 1 Feb 2025 22:51:37 +0500 Subject: feat: layers --- src/floor.hpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/floor.hpp') diff --git a/src/floor.hpp b/src/floor.hpp index a04fc4b..1a6fe47 100644 --- a/src/floor.hpp +++ b/src/floor.hpp @@ -13,9 +13,20 @@ namespace silly::editor { std::shared_ptr tile; }; + struct TileLayer { + std::vector tiles; + TilesetTileType type; + }; + class TileFloor { public: - TileFloor(int width, int height) : width(width), height(height) {} + TileFloor(int width, int height) : width(width), height(height) { + // creating vectors for every tile type + for (int i = 0; i < 2; i++) { + this->layers.push_back({{}, (TilesetTileType)i}); + } + } + ~TileFloor() = default; void render(sf::RenderWindow &window) const; @@ -28,6 +39,7 @@ namespace silly::editor { private: int width, height; - std::vector tiles; + int activeLayerIndex; + std::vector layers; }; } \ No newline at end of file -- cgit v1.2.3