mirror of
https://github.com/digital-jellyfish/Virtu.git
synced 2024-12-02 18:53:57 +00:00
16 lines
380 B
C#
16 lines
380 B
C#
|
namespace Jellyfish.Library
|
|||
|
{
|
|||
|
public static class MathHelpers
|
|||
|
{
|
|||
|
public static int Clamp(int value, int min, int max)
|
|||
|
{
|
|||
|
return (value < min) ? min : (value > max) ? max : value;
|
|||
|
}
|
|||
|
|
|||
|
public static int ClampByte(int value)
|
|||
|
{
|
|||
|
return Clamp(value, byte.MinValue, byte.MaxValue);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|