Exemple #1
0
        public int NextInt(int lower, int upper)
        {
            // [ lower; upper [
            Assert(lower < upper, "lower range cannot be bigger then upper range!");

            return((int)((uint32)(RNG_XORShift.Xorshift128Plus(ref _seedBuffer))
                         % (uint32)(Math.Abs(upper - lower))
                         + lower));
        }
Exemple #2
0
 public void ReSeed()
 {
     RNG_XORShift.XorshiftPlusJump(ref _seedBuffer);
 }
Exemple #3
0
 public uint32 NextUInt32(uint32 range)
 {
     // [ 0; range [
     return((uint32)(RNG_XORShift.Xorshift128Plus(ref _seedBuffer) % (range)));
 }
Exemple #4
0
 public uint64 NextUInt64()
 {
     return(RNG_XORShift.Xorshift128Plus(ref _seedBuffer));
 }