Files
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

32 lines
583 B
C#

using System;
using System.Collections.Generic;
namespace Sandbox;
/// <summary>
/// Hidden random class. This is secretly used by Game.Random, but being here
/// allows all of our system functions to use the same Random instance.
/// </summary>
static class SandboxSystem
{
[ThreadStatic]
static Random _random;
internal static Random Random
{
get
{
_random ??= new Random();
return _random;
}
}
/// <summary>
/// Sets the seed for these static classes
/// </summary>
public static void SetRandomSeed( int seed )
{
_random = new Random( seed );
}
}