X-Git-Url: https://git.yukkurigames.com/?p=enjoyable.git;a=blobdiff_plain;f=Config.m;fp=Config.m;h=0000000000000000000000000000000000000000;hp=189773436a41c7af148000a5834d65aafffa7d6a;hb=e2a4d830dd9817f6a515a3b1b6aa152d3bb98c2b;hpb=f864d363128de19fc6591b77ae9226b34166d715 diff --git a/Config.m b/Config.m deleted file mode 100644 index 1897734..0000000 --- a/Config.m +++ /dev/null @@ -1,45 +0,0 @@ -// -// Config.m -// Enjoy -// -// Created by Sam McCall on 4/05/09. -// - -#import "Config.h" - -#import "NJInput.h" - -@implementation Config - -- (id)initWithName:(NSString *)name { - if ((self = [super init])) { - self.name = name ? name : @"Untitled"; - _entries = [[NSMutableDictionary alloc] init]; - } - return self; -} - -- (Target *)objectForKeyedSubscript:(NJInput *)input { - return input ? _entries[input.uid] : nil; -} - -- (void)setObject:(Target *)target forKeyedSubscript:(NJInput *)input { - if (input) { - if (target) - _entries[input.uid] = target; - else - [_entries removeObjectForKey:input.uid]; - } -} - -- (NSDictionary *)serialize { - NSMutableDictionary* cfgEntries = [[NSMutableDictionary alloc] initWithCapacity:_entries.count]; - for (id key in _entries) { - id serialized = [_entries[key] serialize]; - if (serialized) - cfgEntries[key] = serialized; - } - return @{ @"name": _name, @"entries": cfgEntries }; -} - -@end