From cac7fa97ec7b2db3a3153f9a82a31c59e5c333ae Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Mon, 3 Feb 2025 00:04:41 +0500 Subject: upd: add_entry with id in arguments --- src/sets/tileset.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/sets/tileset.hpp') diff --git a/src/sets/tileset.hpp b/src/sets/tileset.hpp index 0415969..2c02ad0 100644 --- a/src/sets/tileset.hpp +++ b/src/sets/tileset.hpp @@ -19,11 +19,11 @@ namespace silly::editor { class TileSet : public EntrySet { public: - void add_entry(const std::string &path, TilesetTileType type) override { + void add_entry(int id, const std::string &path, TilesetTileType type) { TilesetTile tile; tile.type = type; tile.path = path; - tile.id = this->entries.size(); + tile.id = id; if (!tile.texture.loadFromFile(path)) { // TODO: add logging here @@ -48,6 +48,10 @@ namespace silly::editor { this->entries.push_back(std::make_shared(tile)); } + void add_entry(const std::string &path, TilesetTileType type) override { + add_entry(this->entries.size(), path, type); + } + void remove_entry(const TilesetTile &entry) override { this->entries.resize(std::distance( this->entries.begin(), -- cgit v1.2.3