1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-16 07:06:30 +09:00

XML comments provided for random classes to stomp out last warnings

This commit is contained in:
lidgren
2014-08-25 07:42:43 +00:00
parent f2aa4b4ce2
commit 7440f6da3c
2 changed files with 75 additions and 0 deletions

View File

@@ -9,20 +9,32 @@ namespace Lidgren.Network
/// </summary>
public abstract class NetRandom : Random
{
/// <summary>
/// Get global instance of NetRandom (uses MWCRandom)
/// </summary>
public static NetRandom Instance = new MWCRandom();
private const double c_realUnitInt = 1.0 / ((double)int.MaxValue + 1.0);
/// <summary>
/// Constructor with randomized seed
/// </summary>
public NetRandom()
{
Initialize(NetRandomSeed.GetUInt32());
}
/// <summary>
/// Constructor with provided 32 bit seed
/// </summary>
public NetRandom(int seed)
{
Initialize((uint)seed);
}
/// <summary>
/// (Re)initialize this instance with provided 32 bit seed
/// </summary>
[CLSCompliant(false)]
public virtual void Initialize(uint seed)
{
@@ -154,6 +166,9 @@ namespace Lidgren.Network
buffer[ptr++] = (byte)NextUInt32();
}
/// <summary>
/// Fill the specified buffer with random values
/// </summary>
public override void NextBytes(byte[] buffer)
{
NextBytes(buffer, 0, buffer.Length);