summaryrefslogtreecommitdiff
path: root/src/floor.hpp
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-02-01 22:51:37 +0500
committerilotterytea <iltsu@alright.party>2025-02-01 22:51:37 +0500
commit79c7edc335fc162e9d2ef9acc5cdf41fbd1bac76 (patch)
tree65decb4938ffd096ccdf7da5f26c2eee27818ac5 /src/floor.hpp
parent2f54da5844b959c29788b2a0883ee5dae5bdbbd2 (diff)
feat: layers
Diffstat (limited to 'src/floor.hpp')
-rw-r--r--src/floor.hpp16
1 files changed, 14 insertions, 2 deletions
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<TilesetTile> tile;
};
+ struct TileLayer {
+ std::vector<Tile> 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<Tile> tiles;
+ int activeLayerIndex;
+ std::vector<TileLayer> layers;
};
} \ No newline at end of file