private void Command(string str1) { int deg = 0; string value; CameraMovement.Type type = CameraMovement.Type.None; if (str1.IndexOf("-movementH:") > -1) { type = CameraMovement.Type.Horizontal; value = str1.Split(':')[1]; int.TryParse(value, out deg); setHorizontalDeg(deg); } else if (str1.IndexOf("-movementV:") > -1) { type = CameraMovement.Type.Vertical; value = str1.Split(':')[1]; int.TryParse(value, out deg); setVerticalDeg(deg); } else { return; } if (Response != null) { Response(this, new CameraMovementArgs(type, deg)); } Console.WriteLine("Command: " + str1); }
public CameraMovementArgs(CameraMovement.Type type, int deg) { this.t = type; this.deg = deg; }