/// <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 positive integer between the specified inclusive start /// value and the exclusive end value. /// </summary> public static int GetRandomRange(long seed, long x, long y, long z, int start, int end, long modifier) { unchecked { int a = AlgorithmUtility.GetRandomInt(seed, x, y, z, modifier); if (a < 0) { a += int.MaxValue; } return(a % (end - start) + start); } }
/// <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)); }
/// <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 double GetRandomDouble(long x, long y, long z, long modifier = 0) { return(AlgorithmUtility.GetRandomDouble(this.Seed, x, y, z, modifier)); }
/// <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 long GetRandomLong(long x, long y, long z, long modifier = 0) { return(AlgorithmUtility.GetRandomLong(this.Seed, x, y, z, modifier)); }
/// <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 int GetRandomInt(long x, long y, long z, long modifier = 0) { return(AlgorithmUtility.GetRandomInt(this.Seed, x, y, z, modifier)); }
/// <summary> /// Returns a random positive integer between the specified inclusive start /// value and the exclusive end value. /// </summary> public int GetRandomRange(long x, long y, long z, int start, int end, long modifier) { return(AlgorithmUtility.GetRandomRange(this.Seed, x, y, z, start, end, modifier)); }