From fcb69fd43a029db9f230f701a51338a9fe2ea60b Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sat, 1 Feb 2025 17:14:45 +0500 Subject: feat: ability to place and remove tiles --- src/floor.hpp | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'src/floor.hpp') diff --git a/src/floor.hpp b/src/floor.hpp index 6389dff..cf91ac5 100644 --- a/src/floor.hpp +++ b/src/floor.hpp @@ -1,15 +1,29 @@ #pragma once +#include +#include +#include + namespace silly::editor { - class Floor { + struct Tile { + sf::Vector2i position; + }; + + class TileFloor { public: - Floor(int width, int height) : width(width), height(height) {} - ~Floor() = default; + TileFloor(int width, int height) : width(width), height(height) {} + ~TileFloor() = default; + + void update(const sf::RenderWindow &window); + void render(sf::RenderWindow &window) const; + void place_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; + std::vector tiles; }; } \ No newline at end of file -- cgit v1.2.3