mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-15 23:02:34 +02:00
* Removed the Interfaces folder. * All objects inside the GameObjects subfolders are now in the GameObjects namespace. * Added a Resharper DotSettings file to mark the GameObjects subfolders as not providing namespaces. * Simplified Robust.client.Graphics namespace. * Automated remove redundant using statements.
26 lines
583 B
C#
26 lines
583 B
C#
using System.Collections.Generic;
|
|
|
|
namespace Robust.Shared.Random
|
|
{
|
|
public interface IRobustRandom
|
|
{
|
|
int Next();
|
|
int Next(int minValue, int maxValue);
|
|
int Next(int maxValue);
|
|
double NextDouble();
|
|
void NextBytes(byte[] buffer);
|
|
|
|
void Shuffle<T>(IList<T> list)
|
|
{
|
|
var n = list.Count;
|
|
while (n > 1) {
|
|
n -= 1;
|
|
var k = Next(n + 1);
|
|
var value = list[k];
|
|
list[k] = list[n];
|
|
list[n] = value;
|
|
}
|
|
}
|
|
}
|
|
}
|