public float GetTorque(WheelIndicator wheel) { switch (wheel) { case WheelIndicator.Left: return(leftDriver.Torque); case WheelIndicator.Right: return(rightDriver.Torque); default: throw new System.Exception("Unexpected default case while switching on " + wheel); } }
public static string ToShortString(this WheelIndicator self) { switch (self) { case WheelIndicator.Left: return("L"); case WheelIndicator.Right: return("R"); default: throw new System.Exception("Unexpected default case while switching on " + self); } }
public void SetPower(WheelIndicator wheel, float power) { assertPercent(power); switch (wheel) { case WheelIndicator.Left: leftDriver.Power = power; break; case WheelIndicator.Right: rightDriver.Power = power; break; default: throw new System.Exception("Unexpected default case while switching on " + wheel); } }
public void SetThrottled(WheelIndicator wheel, bool throttled) { switch (wheel) { case WheelIndicator.Left: if (throttled != leftDriver.Throttled) { leftDriver.Throttled = throttled; leftDriver.ThrottledChanged = true; } break; case WheelIndicator.Right: if (throttled != rightDriver.Throttled) { rightDriver.Throttled = throttled; rightDriver.ThrottledChanged = true; } break; default: throw new System.Exception("Unexpected default case while switching on " + wheel); } }