mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
47 lines
857 B
C#
47 lines
857 B
C#
using SS14.Client.Interfaces.Utility;
|
|
using SS14.Shared.IoC;
|
|
using System;
|
|
|
|
namespace SS14.Client.Utility
|
|
{
|
|
[IoCTarget]
|
|
public class Rand : IRand
|
|
{
|
|
private readonly Random rand;
|
|
|
|
public Rand()
|
|
{
|
|
rand = new Random(DateTime.Now.Millisecond);
|
|
}
|
|
|
|
#region IRand Members
|
|
|
|
public int Next()
|
|
{
|
|
return rand.Next();
|
|
}
|
|
|
|
public int Next(int maxValue)
|
|
{
|
|
return rand.Next(maxValue);
|
|
}
|
|
|
|
public int Next(int minValue, int maxValue)
|
|
{
|
|
return rand.Next(minValue, maxValue);
|
|
}
|
|
|
|
public void NextBytes(byte[] buffer)
|
|
{
|
|
rand.NextBytes(buffer);
|
|
}
|
|
|
|
public double NextDouble()
|
|
{
|
|
return rand.NextDouble();
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|