Add helper routine Util.InRange()

0.7.5-pf-bulletsim
Robert Adams 2012-12-22 17:04:53 -08:00
parent 5b2cbc0ae6
commit 3e3c168987
1 changed files with 7 additions and 0 deletions

View File

@ -299,6 +299,13 @@ namespace OpenSim.Framework
x;
}
// Inclusive, within range test (true if equal to the endpoints)
public static bool InRange<T>(T x, T min, T max)
where T : IComparable<T>
{
return x.CompareTo(max) <= 0 && x.CompareTo(min) >= 0;
}
public static uint GetNextXferID()
{
uint id = 0;