mirror of
https://github.com/simtactics/servo.git
synced 2025-03-26 04:39:07 +00:00
19 lines
341 B
C#
19 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;
|
||
|
}
|
||
|
}
|
||
|
}
|