diff options
| author | ilotterytea <iltsu@alright.party> | 2025-02-03 00:04:41 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-02-03 00:04:41 +0500 |
| commit | cac7fa97ec7b2db3a3153f9a82a31c59e5c333ae (patch) | |
| tree | 206b81455e9638ff97666fcc4f860ff229f6ee41 | |
| parent | 1eec0fa77a420cc2e636f34dba5cc1609d41958e (diff) | |
upd: add_entry with id in arguments
| -rw-r--r-- | src/sets/tileset.hpp | 8 |
1 files changed, 6 insertions, 2 deletions
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<TilesetTile, TilesetTileType> { 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<TilesetTile>(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(), |
