summaryrefslogtreecommitdiff
path: root/src/sets/tileset.hpp
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-02-02 22:41:32 +0500
committerilotterytea <iltsu@alright.party>2025-02-02 22:41:32 +0500
commitf27bf2dfa4975c7366013bb2f729a9823105361c (patch)
tree47938d971e1bebb36765fdd44ed37680147e87b9 /src/sets/tileset.hpp
parent4466b394cbdd584d70f83024852a710a6460212e (diff)
feat: export package
Diffstat (limited to 'src/sets/tileset.hpp')
-rw-r--r--src/sets/tileset.hpp15
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