19 lines
540 B
C#
19 lines
540 B
C#
namespace SantaClausInc.Core;
|
|
|
|
/// <summary>
|
|
/// Provides a <see cref="Random" /> instance.
|
|
/// </summary>
|
|
public static class RandomProvider
|
|
{
|
|
private static Random? _overriddenInstance;
|
|
|
|
/// <summary>
|
|
/// Gets a default or, if overridden, a custom random instance.
|
|
/// Allows to override the default random instance with a specific, seeded one.
|
|
/// </summary>
|
|
public static Random Random
|
|
{
|
|
get => _overriddenInstance ?? Random.Shared;
|
|
set => _overriddenInstance = value;
|
|
}
|
|
}
|