From 500cb9b7160f427dd5aa5363564d3cb84f690b8c Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sat, 16 May 2020 12:53:58 -0400 Subject: [PATCH] Fix groups stealing Ids --- .../GamecraftModdingAPI.csproj | 2 +- .../Utility/ApiExclusiveGroups.cs | 28 +++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/GamecraftModdingAPI/GamecraftModdingAPI.csproj b/GamecraftModdingAPI/GamecraftModdingAPI.csproj index 06c6396..a27b050 100644 --- a/GamecraftModdingAPI/GamecraftModdingAPI.csproj +++ b/GamecraftModdingAPI/GamecraftModdingAPI.csproj @@ -3,7 +3,7 @@ net472 true - 1.0.0 + 1.0.1 Exmods GNU General Public Licence 3+ https://git.exmods.org/modtainers/GamecraftModdingAPI diff --git a/GamecraftModdingAPI/Utility/ApiExclusiveGroups.cs b/GamecraftModdingAPI/Utility/ApiExclusiveGroups.cs index bc7e8ab..19211e6 100644 --- a/GamecraftModdingAPI/Utility/ApiExclusiveGroups.cs +++ b/GamecraftModdingAPI/Utility/ApiExclusiveGroups.cs @@ -10,10 +10,34 @@ namespace GamecraftModdingAPI.Utility { public static class ApiExclusiveGroups { - public static readonly ExclusiveGroup eventsExclusiveGroup = new ExclusiveGroup("GamecraftModdingAPI EventGroup"); + private static ExclusiveGroup _eventsExclusiveGroup = null; + + public static ExclusiveGroup eventsExclusiveGroup + { + get + { + if (_eventsExclusiveGroup == null) + { + _eventsExclusiveGroup = new ExclusiveGroup("GamecraftModdingAPI EventGroup"); + } + return _eventsExclusiveGroup; + } + } public static uint eventID; - public static readonly ExclusiveGroup versionGroup = new ExclusiveGroup("GamecraftModdingAPI VersionGroup"); + private static ExclusiveGroup _versionGroup = null; + + public static ExclusiveGroup versionGroup + { + get + { + if (_versionGroup == null) + { + _versionGroup = new ExclusiveGroup("GamecraftModdingAPI VersionGroup"); + } + return _versionGroup; + } + } } }