Index hat switch names. Remove JSAction index properties entirely, once the name...
[enjoyable.git] / JSAction.m
index 84d1ea8..0216e58 100644 (file)
 @implementation JSAction
 
 @synthesize cookie;
-@synthesize index;
 @synthesize children;
 @synthesize base;
 @synthesize name;
+@synthesize active;
+
+- (id)initWithName:(NSString *)newName base:(JSAction *)newBase {
+    if ((self = [super init])) {
+        self.name = newName;
+        self.base = newBase;
+    }
+    return self;
+}
 
 - (id)findSubActionForValue:(IOHIDValueRef)value {
     return NULL;
 }
 
-- (NSString *)stringify {
-    return [NSString stringWithFormat: @"%@~%p", [base stringify], cookie];
+- (NSString *)uid {
+    return [NSString stringWithFormat:@"%@~%@", [self.base uid], self.name];
 }
 
 - (void)notifyEvent:(IOHIDValueRef)value {
     [self doesNotRecognizeSelector:_cmd];
 }
 
-- (BOOL)active {
-    [self doesNotRecognizeSelector:_cmd];
-    return NO;
+- (float)magnitude {
+    return 0.f;
 }
 
 @end