projects
/
enjoyable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Big rename part 1: 'action' to 'input'.
[enjoyable.git]
/
Config.m
diff --git
a/Config.m
b/Config.m
index
a02c4ce
..
1897734
100644
(file)
--- a/
Config.m
+++ b/
Config.m
@@
-7,35
+7,38
@@
#import "Config.h"
#import "Config.h"
-#import "
JSAction
.h"
+#import "
NJInput
.h"
@implementation Config
- (id)initWithName:(NSString *)name {
if ((self = [super init])) {
@implementation Config
- (id)initWithName:(NSString *)name {
if ((self = [super init])) {
- self.name = name;
+ self.name = name
? name : @"Untitled"
;
_entries = [[NSMutableDictionary alloc] init];
}
return self;
}
_entries = [[NSMutableDictionary alloc] init];
}
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)
if (target)
- _entries[
action
.uid] = target;
+ _entries[
input
.uid] = target;
else
else
- [_entries removeObjectForKey:
action
.uid];
+ [_entries removeObjectForKey:
input
.uid];
}
}
- (NSDictionary *)serialize {
NSMutableDictionary* cfgEntries = [[NSMutableDictionary alloc] initWithCapacity:_entries.count];
}
}
- (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 };
}
return @{ @"name": _name, @"entries": cfgEntries };
}