aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/pink/utils.h24
1 files changed, 22 insertions, 2 deletions
diff --git a/engines/pink/utils.h b/engines/pink/utils.h
index d5ef9a4c77..2a01ba9325 100644
--- a/engines/pink/utils.h
+++ b/engines/pink/utils.h
@@ -30,7 +30,7 @@ namespace Pink {
template <typename T>
class Array : public Common::Array<T>, public Object {
public:
- virtual void deserialize(Archive &archive) {
+ void deserialize(Archive &archive) {
uint size = archive.readCount();
this->resize(size);
for (uint i = 0; i < size; ++i) {
@@ -41,7 +41,7 @@ public:
class StringArray : public Common::StringArray {
public:
- inline void deserialize(Archive &archive) {
+ void deserialize(Archive &archive) {
uint32 size = archive.readCount();
this->resize(size);
for (uint i = 0; i < size; ++i) {
@@ -50,6 +50,26 @@ public:
}
};
+class StringMap : public Common::StringMap {
+public:
+ void serialize(Archive &archive) {
+ archive.writeWORD(size());
+ for (Common::StringMap::const_iterator it = begin(); it != end(); ++it) {
+ archive.writeString(it->_key);
+ archive.writeString(it->_value);
+ }
+ }
+
+ void deserialize(Archive &archive) {
+ uint size = archive.readWORD();
+ for (uint i = 0; i < size; ++i) {
+ Common::String key = archive.readString();
+ Common::String val = archive.readString();
+ setVal(key, val);
+ }
+ }
+};
+
} // End of namespace Pink
#endif