mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-04 15:15:01 +00:00
Move Common functionality to Core project & rendering and Model support as well
This commit is contained in:
16
PckStudio.Core/Extensions/MathExtensions.cs
Normal file
16
PckStudio.Core/Extensions/MathExtensions.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
|
||||
namespace PckStudio.Core.Extensions
|
||||
{
|
||||
public class MathExtensions
|
||||
{
|
||||
public 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user