diff options
author | Robert Adams | 2012-12-22 17:04:53 -0800 |
---|---|---|
committer | Robert Adams | 2012-12-22 17:04:53 -0800 |
commit | 3e3c168987ba235ecb05079ed86e0ad3b6fe0dc8 (patch) | |
tree | 8211ef266ef186f63b4d0118c1c11ad53e3c67a4 /OpenSim/Framework/Util.cs | |
parent | BulletSim: remove all special vehicle code from BSScene. Replace per-frame up... (diff) | |
download | opensim-SC-3e3c168987ba235ecb05079ed86e0ad3b6fe0dc8.zip opensim-SC-3e3c168987ba235ecb05079ed86e0ad3b6fe0dc8.tar.gz opensim-SC-3e3c168987ba235ecb05079ed86e0ad3b6fe0dc8.tar.bz2 opensim-SC-3e3c168987ba235ecb05079ed86e0ad3b6fe0dc8.tar.xz |
Add helper routine Util.InRange()
Diffstat (limited to 'OpenSim/Framework/Util.cs')
-rw-r--r-- | OpenSim/Framework/Util.cs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 0c657c5..ea2d28a 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -299,6 +299,13 @@ namespace OpenSim.Framework | |||
299 | x; | 299 | x; |
300 | } | 300 | } |
301 | 301 | ||
302 | // Inclusive, within range test (true if equal to the endpoints) | ||
303 | public static bool InRange<T>(T x, T min, T max) | ||
304 | where T : IComparable<T> | ||
305 | { | ||
306 | return x.CompareTo(max) <= 0 && x.CompareTo(min) >= 0; | ||
307 | } | ||
308 | |||
302 | public static uint GetNextXferID() | 309 | public static uint GetNextXferID() |
303 | { | 310 | { |
304 | uint id = 0; | 311 | uint id = 0; |