mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
clean up OptionGroupSingleton.cs
This commit is contained in:
1 parent
a07c332dce
commit
0f26cadd9a
1 file changed
+2
-4
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
|
||||
namespace MiraAPI.GameOptions;
|
||||
|
||||
@@ -7,13 +6,12 @@ namespace MiraAPI.GameOptions;
|
||||
/// Singleton for option groups.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The option group type.</typeparam>
|
||||
public class OptionGroupSingleton<T> where T : AbstractOptionGroup
|
||||
public static class OptionGroupSingleton<T> where T : AbstractOptionGroup
|
||||
{
|
||||
private static T? _instance;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the instance of the option group.
|
||||
/// </summary>
|
||||
/// <exception cref="InvalidOperationException">Can't</exception>
|
||||
public static T Instance => _instance ??= ModdedOptionsManager.Groups.OfType<T>().Single();
|
||||
}
|
||||
Reference in new issue
Block a user