public static int ClampInt(int Value, int Min, int Max) { if (Value < Min) Value = Min; else if (Value > Max) Value = Max; return Value; }