using System; using System.Collections.Generic; namespace Sandbox; /// /// 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. /// static class SandboxSystem { [ThreadStatic] static Random _random; internal static Random Random { get { _random ??= new Random(); return _random; } } /// /// Sets the seed for these static classes /// public static void SetRandomSeed( int seed ) { _random = new Random( seed ); } }