diff options
Diffstat (limited to 'src/SMAPI/Framework/Singleton.cs')
-rw-r--r-- | src/SMAPI/Framework/Singleton.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/Singleton.cs b/src/SMAPI/Framework/Singleton.cs new file mode 100644 index 00000000..399a8bf0 --- /dev/null +++ b/src/SMAPI/Framework/Singleton.cs @@ -0,0 +1,10 @@ +namespace StardewModdingAPI.Framework +{ + /// <summary>Provides singleton instances of a given type.</summary> + /// <typeparam name="T">The instance type.</typeparam> + internal static class Singleton<T> where T : new() + { + /// <summary>The singleton instance.</summary> + public static T Instance { get; } = new T(); + } +} |