Diagonal movement GeoEngine.
This commit is contained in:
@@ -80,4 +80,15 @@ public class MathUtil
|
||||
{
|
||||
return oldValue / value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param numToTest : The number to test.
|
||||
* @param min : The minimum limit.
|
||||
* @param max : The maximum limit.
|
||||
* @return the number or one of the limit (mininum / maximum).
|
||||
*/
|
||||
public static int limit(int numToTest, int min, int max)
|
||||
{
|
||||
return (numToTest > max) ? max : ((numToTest < min) ? min : numToTest);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user