#pragma once #include #include #include #include #include "tileset.hpp" namespace silly::editor { struct Tile { sf::Vector2i position; std::shared_ptr tile; }; struct TileLayer { std::vector tiles; TilesetTileType type; }; class TileFloor { public: 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; void place_tile(std::shared_ptr &tile, const sf::Vector2i &position); void remove_tile(const sf::Vector2i &position); const int get_width() const; const int get_height() const; private: int width, height; int activeLayerIndex; std::vector layers; }; }