mirror of
https://github.com/rafi1212122/BLHX.Server.git
synced 2025-12-13 15:04:37 +01:00
18 lines
321 B
C#
18 lines
321 B
C#
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;
|
|
}
|
|
}
|