servo/source/Servo.MotiveEngine/ExtensionUtils.cs
Anthony Leland 2993056967 Servo VS solution
- Created VS solution for expanding upon the notebook code
- Renamed LimitToRange() to MaxLimit() and adjusted it's algorithm
2020-10-28 23:29:49 -04:00

18 lines
341 B
C#

using System;
namespace Servo.MotiveEngine
{
public static class ExtensionUtils
{
public static int MaxLimit(this int val, int max)
{
if (max < 0)
throw new ArgumentOutOfRangeException();
if (val >= max)
return max;
return val;
}
}
}