projects
/
enjoyable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
This isn't C++.
[enjoyable.git]
/
Config.m
diff --git
a/Config.m
b/Config.m
index
27ca4f0
..
84e6c32
100644
(file)
--- a/
Config.m
+++ b/
Config.m
@@
-5,22
+5,35
@@
// Created by Sam McCall on 4/05/09.
//
// Created by Sam McCall on 4/05/09.
//
-@implementation Config
+#import "Config.h"
--(id) init {
- if(self=[super init]) {
- entries = [[NSMutableDictionary alloc] init];
- }
- return self;
+#import "JSAction.h"
+
+@implementation Config {
+ NSMutableDictionary *entries;
}
}
-@synthesize protect, name, entries;
+@synthesize name;
+@synthesize entries;
+
+- (id)init {
+ if ((self = [super init])) {
+ entries = [[NSMutableDictionary alloc] init];
+ }
+ return self;
+}
--
(void) setTarget:(Target*)target forAction:(id)jsa
{
-
[entries setValue:target forKey: [jsa stringify]]
;
+-
(Target *)objectForKeyedSubscript:(JSAction *)action
{
+
return action ? entries[action.uid] : nil
;
}
}
--(Target*) getTargetForAction: (id) jsa {
- return entries[[jsa stringify]];
+
+- (void)setObject:(Target *)target forKeyedSubscript:(JSAction *)action {
+ if (action) {
+ if (target)
+ entries[action.uid] = target;
+ else
+ [entries removeObjectForKey:action.uid];
+ }
}
@end
}
@end