From bc9d1725c5cca89f43c8e314e6bb8088f75acf27 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sun, 2 Feb 2025 15:08:42 +0500 Subject: feat: a base class for sets --- src/tileset.cpp | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 src/tileset.cpp (limited to 'src/tileset.cpp') 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 - -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(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 &t) { - return t.get()->id == tile.id; - }))); - } - - const std::vector> &Tileset::get_tiles() const { - return this->tiles; - } -} \ No newline at end of file -- cgit v1.2.3