Skip to content

Commit

Permalink
Warnings fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
lidgren committed Aug 25, 2014
1 parent 82fcede commit eb9dbdd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions Lidgren.Network/NetRandom.Implementations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Lidgren.Network
/// </summary>
public class MWCRandom : NetRandom
{
public static readonly MWCRandom Instance = new MWCRandom();
public static new readonly MWCRandom Instance = new MWCRandom();

private uint m_w, m_z;

Expand Down Expand Up @@ -45,7 +45,7 @@ public override uint NextUInt32()
/// </summary>
public sealed class XorShiftRandom : NetRandom
{
public static readonly XorShiftRandom Instance = new XorShiftRandom();
public static new readonly XorShiftRandom Instance = new XorShiftRandom();

private const uint c_x = 123456789;
private const uint c_y = 362436069;
Expand Down Expand Up @@ -97,7 +97,7 @@ public override uint NextUInt32()
/// </summary>
public sealed class MersenneTwisterRandom : NetRandom
{
public static readonly MersenneTwisterRandom Instance = new MersenneTwisterRandom();
public static new readonly MersenneTwisterRandom Instance = new MersenneTwisterRandom();

private const int N = 624;
private const int M = 397;
Expand Down Expand Up @@ -184,7 +184,7 @@ private void GenRandAll()
/// </summary>
public class CryptoRandom : NetRandom
{
public static readonly CryptoRandom Instance = new CryptoRandom();
public static new readonly CryptoRandom Instance = new CryptoRandom();

private RandomNumberGenerator m_rnd = new RNGCryptoServiceProvider();

Expand Down
14 changes: 7 additions & 7 deletions Lidgren.Network/NetRandom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public virtual uint NextUInt32()
}

/// <summary>
/// Generates a random value that is >= 0 and < Int32.MaxValue
/// Generates a random value that is greater or equal than 0 and less than Int32.MaxValue
/// </summary>
public override int Next()
{
Expand All @@ -52,31 +52,31 @@ public override int Next()
}

/// <summary>
/// Generates a random value >= 0 and <= Int32.MaxValue (inclusively)
/// Generates a random value greater or equal than 0 and less or equal than Int32.MaxValue (inclusively)
/// </summary>
public int NextInt32()
{
return (int)(0x7FFFFFFF & NextUInt32());
}

/// <summary>
/// Returns random value >= 0.0 and < 1.0
/// Returns random value larger or equal to 0.0 and less than 1.0
/// </summary>
public override double NextDouble()
{
return c_realUnitInt * NextInt32();
}

/// <summary>
/// Returns random value >= 0.0 and < 1.0
/// Returns random value is greater or equal than 0.0 and less than 1.0
/// </summary>
protected override double Sample()
{
return c_realUnitInt * NextInt32();
}

/// <summary>
/// Returns random value >= 0.0f and < 1.0f
/// Returns random value is greater or equal than 0.0f and less than 1.0f
/// </summary>
public float NextSingle()
{
Expand All @@ -87,15 +87,15 @@ public float NextSingle()
}

/// <summary>
/// Returns a random value >= 0 and < maxValue
/// Returns a random value is greater or equal than 0 and less than maxValue
/// </summary>
public override int Next(int maxValue)
{
return (int)(NextDouble() * maxValue);
}

/// <summary>
/// Returns a random value >= minValue and < maxValue
/// Returns a random value is greater or equal than minValue and less than maxValue
/// </summary>
public override int Next(int minValue, int maxValue)
{
Expand Down

0 comments on commit eb9dbdd

Please sign in to comment.