summaryrefslogtreecommitdiff
path: root/src/sets/tileset.hpp
diff options
context:
space:
mode:
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