mirror of
https://github.com/raphaeIl/Novaria.git
synced 2025-12-12 14:34:38 +01:00
25 lines
494 B
C#
25 lines
494 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Novaria.Common.Util
|
|
{
|
|
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;
|
|
}
|
|
}
|
|
}
|