Move logic into messages rather than directly in the callback functions.
[enjoyable.git] / TargetMouseMove.m
index f75f70b..8bbfd42 100644 (file)
     return YES;
 }
 
-@synthesize dir;
-
 + (NSString *)serializationCode {
     return @"mmove";
 }
 
 - (NSDictionary *)serialize {
-    return @{ @"type": @"mmove", @"dir": @(self.dir) };
+    return @{ @"type": @"mmove", @"axis": @(_axis) };
 }
 
 + (Target *)targetDeserialize:(NSDictionary *)serialization
                   withConfigs:(NSArray *)configs {
        TargetMouseMove *target = [[TargetMouseMove alloc] init];
-    target.dir = [serialization[@"dir"] intValue];
+    target.axis = [serialization[@"axis"] intValue];
        return target;
 }
 
@@ -57,7 +55,7 @@
     if ([jc frontWindowOnly])
         speed = 12.f;
     float dx = 0.f, dy = 0.f;
-    if (self.dir == 0)
+    if (_axis == 0)
         dx = self.magnitude * speed;
     else
         dy = self.magnitude * speed;