public void Randomize(double num) { int num1 = _seed; int num2 = !BitConverter.IsLittleEndian ? BitConverter.ToInt32(BitConverter.GetBytes(num), 0) : BitConverter.ToInt32(BitConverter.GetBytes(num), 4); int num3 = (num2 & (int)ushort.MaxValue ^ num2 >> 16) << 8; int num4 = num1 & -16776961 | num3; _seed = num4; }
public void Randomize() { System.DateTime now = System.DateTime.Now; float timer = (float)checked ((60 * now.Hour + now.Minute) * 60 + now.Second) + (float)now.Millisecond / 1000f; int num1 = _seed; int num2 = BitConverter.ToInt32(BitConverter.GetBytes(timer), 0); int num3 = (num2 & (int)ushort.MaxValue ^ num2 >> 16) << 8; int num4 = num1 & -16776961 | num3; _seed = num4; }
public float VBNext(float num) { int num1 = _seed; if ((double)num != 0.0) { if ((double)num < 0.0) { long num2 = (long)BitConverter.ToInt32(BitConverter.GetBytes(num), 0) & (long)uint.MaxValue; num1 = checked ((int)(num2 + (num2 >> 24) & 16777215L)); } num1 = checked ((int)((long)num1 * 1140671485L + 12820163L & 16777215L)); } _seed = num1; return((float)num1 / 1.677722E+07f); }
/// <summary> /// Reads the value of the specified type from the buffer. /// </summary> /// <param name="value">The OUT variable to store the INT value in.</param> /// <exception cref="System.ArgumentException"/> /// <exception cref="System.ArgumentNullException"/> /// <exception cref="System.ArgumentOutOfRangeException"/> public void Read(out int value) { value = BitConverter.ToInt32(memory, iterator); iterator = (iterator + (int)BufferTypeSize.Int32 + fastAlign) & fastAlignNot; }