summaryrefslogtreecommitdiff
path: root/src/tileset.cpp
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-02-02 15:08:42 +0500
committerilotterytea <iltsu@alright.party>2025-02-02 15:08:57 +0500
commitbc9d1725c5cca89f43c8e314e6bb8088f75acf27 (patch)
tree26acb17b7232bd2fb7d065299b2c2e0927247eeb /src/tileset.cpp
parent34f081520c754cc20c2ec929be7798fe3f3806e1 (diff)
feat: a base class for sets
Diffstat (limited to 'src/tileset.cpp')
-rw-r--r--src/tileset.cpp31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/tileset.cpp b/src/tileset.cpp
deleted file mode 100644
index 5e5b47a..0000000
--- a/src/tileset.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-#include "tileset.hpp"
-
-#include <memory>
-
-namespace silly::editor {
- void Tileset::add_tile(const std::string &path, TilesetTileType type) {
- TilesetTile tile;
- tile.type = type;
- tile.id = this->tiles.size();
-
- if (!tile.texture.loadFromFile(path)) {
- // TODO: add logging here
- return;
- }
-
- this->tiles.push_back(std::make_shared<TilesetTile>(tile));
- }
-
- void Tileset::remove_tile(const TilesetTile &tile) {
- this->tiles.resize(std::distance(
- this->tiles.begin(),
- std::remove_if(this->tiles.begin(), this->tiles.end(),
- [&tile](const std::shared_ptr<TilesetTile> &t) {
- return t.get()->id == tile.id;
- })));
- }
-
- const std::vector<std::shared_ptr<TilesetTile>> &Tileset::get_tiles() const {
- return this->tiles;
- }
-} \ No newline at end of file