diff options
| author | ilotterytea <iltsu@alright.party> | 2025-02-02 22:41:32 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-02-02 22:41:32 +0500 |
| commit | f27bf2dfa4975c7366013bb2f729a9823105361c (patch) | |
| tree | 47938d971e1bebb36765fdd44ed37680147e87b9 /src/sets/tileset.hpp | |
| parent | 4466b394cbdd584d70f83024852a710a6460212e (diff) | |
feat: export package
Diffstat (limited to 'src/sets/tileset.hpp')
| -rw-r--r-- | src/sets/tileset.hpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/sets/tileset.hpp b/src/sets/tileset.hpp index 0206f1c..8562e0f 100644 --- a/src/sets/tileset.hpp +++ b/src/sets/tileset.hpp @@ -56,5 +56,20 @@ namespace silly::editor { return t.get()->id == entry.id; }))); } + + std::string export_to_string() const { + std::ostringstream oss; + + oss << "[tileset]\n" + << "# id;type;name.extension\n"; + + for (auto it = this->entries.begin(); it != this->entries.end(); ++it) { + TilesetTile *t = it->get(); + oss << std::to_string(t->id) << ";" << std::to_string(t->type) << ";" + << t->name << "." << t->extension << "\n"; + } + + return oss.str(); + } }; }
\ No newline at end of file |
