mirror of
https://github.com/simtactics/servo.git
synced 2025-03-24 03:39:07 +00:00
- Created VS solution for expanding upon the notebook code - Renamed LimitToRange() to MaxLimit() and adjusted it's algorithm
18 lines
341 B
C#
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;
|
|
}
|
|
}
|
|
}
|