summaryrefslogtreecommitdiff
path: root/src/editor.hpp
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-02-01 21:39:43 +0500
committerilotterytea <iltsu@alright.party>2025-02-01 21:39:43 +0500
commitc89db32c69c2ca3db059193591ec910d45fbbcc3 (patch)
treefc47fd9296273a8087f250af434f78387c092d5a /src/editor.hpp
parent50e4d4c490782d878cb8777348c3c285f60cd592 (diff)
feat: tile creation + editor panel
Diffstat (limited to 'src/editor.hpp')
-rw-r--r--src/editor.hpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/editor.hpp b/src/editor.hpp
new file mode 100644
index 0000000..eba7f14
--- /dev/null
+++ b/src/editor.hpp
@@ -0,0 +1,31 @@
+#pragma once
+
+#include <SFML/Graphics/RenderWindow.hpp>
+#include <SFML/Graphics/Texture.hpp>
+#include <optional>
+#include <string>
+
+#include "floor.hpp"
+#include "tileset.hpp"
+
+namespace silly::editor {
+ struct NewTileState {
+ std::string path;
+ sf::Texture texture;
+ TilesetTileType type;
+ };
+
+ class Editor {
+ public:
+ Editor(Tileset &tileset, TileFloor &floor)
+ : tileset(tileset), floor(floor) {}
+
+ void update(const sf::RenderWindow &window);
+ void render(const sf::RenderWindow &window);
+
+ private:
+ Tileset &tileset;
+ TileFloor &floor;
+ std::optional<NewTileState> newTileState;
+ };
+} \ No newline at end of file