diff options
| author | ilotterytea <iltsu@alright.party> | 2025-02-01 17:14:45 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-02-01 17:14:45 +0500 |
| commit | fcb69fd43a029db9f230f701a51338a9fe2ea60b (patch) | |
| tree | 6ef1f580d380b3daa0fb91fdefb010a3217c98bf /src/floor.hpp | |
| parent | 0c7c29d669c16c3821b19d00a9319f3eba5cf05d (diff) | |
feat: ability to place and remove tiles
Diffstat (limited to 'src/floor.hpp')
| -rw-r--r-- | src/floor.hpp | 20 |
1 files changed, 17 insertions, 3 deletions
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 <SFML/Graphics/RenderWindow.hpp> +#include <SFML/System/Vector2.hpp> +#include <vector> + 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<Tile> tiles; }; }
\ No newline at end of file |
