コード例 #1
0
ファイル: AlgorithmUtility.cs プロジェクト: duaneking/Tychaia
 /// <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);
     }
 }
コード例 #2
0
 /// <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));
 }