X-Git-Url: https://git.yukkurigames.com/?p=enjoyable.git;a=blobdiff_plain;f=Config.m;h=189773436a41c7af148000a5834d65aafffa7d6a;hp=55162b081baa3270f35037fe0c00caed42bd18e2;hb=f864d363128de19fc6591b77ae9226b34166d715;hpb=794561a4606fa9e31e3b2b077891f5b1e6084698 diff --git a/Config.m b/Config.m index 55162b0..1897734 100644 --- a/Config.m +++ b/Config.m @@ -7,7 +7,7 @@ #import "Config.h" -#import "JSAction.h" +#import "NJInput.h" @implementation Config @@ -19,23 +19,26 @@ return self; } -- (Target *)objectForKeyedSubscript:(JSAction *)action { - return action ? _entries[action.uid] : nil; +- (Target *)objectForKeyedSubscript:(NJInput *)input { + return input ? _entries[input.uid] : nil; } -- (void)setObject:(Target *)target forKeyedSubscript:(JSAction *)action { - if (action) { +- (void)setObject:(Target *)target forKeyedSubscript:(NJInput *)input { + if (input) { if (target) - _entries[action.uid] = target; + _entries[input.uid] = target; else - [_entries removeObjectForKey:action.uid]; + [_entries removeObjectForKey:input.uid]; } } - (NSDictionary *)serialize { NSMutableDictionary* cfgEntries = [[NSMutableDictionary alloc] initWithCapacity:_entries.count]; - for (id key in _entries) - cfgEntries[key] = [_entries[key] serialize]; + for (id key in _entries) { + id serialized = [_entries[key] serialize]; + if (serialized) + cfgEntries[key] = serialized; + } return @{ @"name": _name, @"entries": cfgEntries }; }