mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-03 18:15:50 +00:00
19 lines
438 B
C#
19 lines
438 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace PckStudio.Extensions
|
|
{
|
|
internal class MathExtensions
|
|
{
|
|
internal static T Clamp<T>(T value, T min, T max) where T : IComparable<T>
|
|
{
|
|
if (value.CompareTo(min) < 0) return min;
|
|
if (value.CompareTo(max) > 0) return max;
|
|
return value;
|
|
}
|
|
}
|
|
}
|