mirror of
https://github.com/rafi1212122/BLHX.Server.git
synced 2025-12-15 07:54:36 +01:00
utils for JSON files and RNG/rolling, abstracted arg parsing for commands
This commit is contained in:
17
BLHX.Server.Common/Utils/Singleton.cs
Normal file
17
BLHX.Server.Common/Utils/Singleton.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace BLHX.Server.Common.Utils;
|
||||
|
||||
public abstract class Singleton<T> where T : new()
|
||||
{
|
||||
static T instance;
|
||||
public static T Instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (instance == null)
|
||||
instance = new T();
|
||||
|
||||
return instance;
|
||||
}
|
||||
set => instance = value;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user