/// <summary> /// Returns a random integer over the range of valid integers based /// on the provided X and Y position, and the specified modifier. /// </summary> public static int GetRandomInt(long seed, long x, long y, long z, long modifier = 0) { unchecked { return((int)(AlgorithmUtility.GetRandomNumber(seed, x, y, z, modifier) % int.MaxValue)); } }
/// <summary> /// Returns a random double between the range of 0.0 and 1.0 based on /// the provided X and Y position, and the specified modifier. /// </summary> public static double GetRandomDouble(long seed, long x, long y, long z, long modifier = 0) { long a = AlgorithmUtility.GetRandomNumber(seed, x, y, z, modifier) / 2; if (a < 0) { a += long.MaxValue; } return((double)a / (double)long.MaxValue); }
/// <summary> /// Returns a random long integer over the range of valid long integers based /// on the provided X and Y position, and the specified modifier. /// </summary> public static long GetRandomLong(long seed, long x, long y, long z, long modifier = 0) { return(AlgorithmUtility.GetRandomNumber(seed, x, y, z, modifier)); }