Browse Source

Remove serializer registration at startup

tags/v1.1.0
NGnius (Graham) 4 years ago
parent
commit
ebea9da232
2 changed files with 9 additions and 7 deletions
  1. +1
    -1
      GamecraftModdingAPI/GamecraftModdingAPI.csproj
  2. +8
    -6
      GamecraftModdingAPI/Utility/VersionTracking.cs

+ 1
- 1
GamecraftModdingAPI/GamecraftModdingAPI.csproj View File

@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
<Authors>Exmods</Authors>
<PackageLicenseExpression>GNU General Public Licence 3+</PackageLicenseExpression>
<PackageProjectUrl>https://git.exmods.org/modtainers/GamecraftModdingAPI</PackageProjectUrl>


+ 8
- 6
GamecraftModdingAPI/Utility/VersionTracking.cs View File

@@ -35,6 +35,12 @@ namespace GamecraftModdingAPI.Utility
/// </summary>
public static void Enable()
{
if (!SerializerManager.ExistsSerializer(typeof(ModVersionStruct).FullName))
{
SerializerManager.AddSerializer<ModVersionDescriptor>(new SimpleEntitySerializer<ModVersionDescriptor>(
(_) => { return new EGID[1] { new EGID(0u, ApiExclusiveGroups.versionGroup) }; }
));
}
EventManager.AddEventEmitter(versionEngine);
isEnabled = true;
}
@@ -48,12 +54,8 @@ namespace GamecraftModdingAPI.Utility
isEnabled = false;
}

public static void Init()
{
SerializerManager.AddSerializer<ModVersionDescriptor>(new SimpleEntitySerializer<ModVersionDescriptor>(
(_) => { return new EGID[1] { new EGID(0u, ApiExclusiveGroups.versionGroup) }; }
));
}
public static void Init() { }

}

internal class VersionTrackingEngine : IEventEmitterEngine


Loading…
Cancel
Save