summaryrefslogtreecommitdiff
path: root/src/tileset.hpp
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-02-01 21:34:22 +0500
committerilotterytea <iltsu@alright.party>2025-02-01 21:34:22 +0500
commit30e261ce0220110db201e522e751b1c82c0b5683 (patch)
tree5d0c32423c8e97da986d68400aaa18b7a425abd4 /src/tileset.hpp
parentfcb69fd43a029db9f230f701a51338a9fe2ea60b (diff)
feat: tileset
Diffstat (limited to 'src/tileset.hpp')
-rw-r--r--src/tileset.hpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/tileset.hpp b/src/tileset.hpp
new file mode 100644
index 0000000..2b65356
--- /dev/null
+++ b/src/tileset.hpp
@@ -0,0 +1,30 @@
+#pragma once
+
+#include <SFML/Graphics/Texture.hpp>
+#include <string>
+#include <vector>
+
+#define TILE_WIDTH 16
+#define TILE_HEIGHT 16
+
+namespace silly::editor {
+ enum TilesetTileType { TILE_FLOOR = 0, TILE_WALL };
+ struct TilesetTile {
+ int id;
+ sf::Texture texture;
+ TilesetTileType type;
+ };
+
+ class Tileset {
+ public:
+ Tileset() = default;
+ ~Tileset() = default;
+
+ void add_tile(const std::string &path, TilesetTileType type);
+ void remove_tile(const TilesetTile &tile);
+ const std::vector<TilesetTile> &get_tiles() const;
+
+ private:
+ std::vector<TilesetTile> tiles;
+ };
+} \ No newline at end of file