Allow JSON export of configurations.
[enjoyable.git] / Config.m
index 5a83ed3..a02c4ce 100644 (file)
--- a/Config.m
+++ b/Config.m
     }
 }
 
+- (NSDictionary *)serialize {
+    NSMutableDictionary* cfgEntries = [[NSMutableDictionary alloc] initWithCapacity:_entries.count];
+    for (id key in _entries)
+        cfgEntries[key] = [_entries[key] serialize];
+    return @{ @"name": _name, @"entries": cfgEntries };
+}
+
 @end