private static void HandleMoveCommand(Command command) { //Todo: position convert fixup? var position = new DevicePosition() { x = currentPosition.X, y = currentPosition.Y, z = currentPosition.Z }; switch (command.Direction) { case "left": position.x -= command.StepSize; break; case "up": position.y -= command.StepSize; break; case "right": position.x += command.StepSize; break; case "down": position.y += command.StepSize; break; } _socket.Emit("moveRobot", JObject.FromObject(position)); }
private static void HandleCommand(Command command) { _socket.Connect(); var position = new DevicePosition() { x = currentPosition.X, y = currentPosition.Y, z = currentPosition.Z }; //fex. moveRobot switch (command.Name) { case "moveRobot": HandleMoveCommand(command); break; case "placeBox": _socket.Emit("placeBox", JObject.FromObject(position)); break; case "pickupBox": _socket.Emit("pickupBox", JObject.FromObject(position)); break; default: break; } }