TechbloxModdingAPI/GamecraftModdingAPI/Events/DeterministicStepComposeEngineGroupsPatch.cs

35 lines
1 KiB
C#
Raw Normal View History

using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using Harmony;
using Svelto.ECS;
using RobocraftX.StateSync;
using GamecraftModdingAPI.Utility;
namespace GamecraftModdingAPI.Events
{
/// <summary>
/// Patch of RobocraftX.StateSync.DeterministicStepCompositionRoot.ComposeEnginesGroups(...)
/// </summary>
[HarmonyPatch(typeof(DeterministicStepCompositionRoot), "ComposeEnginesGroups")]
//[HarmonyPatch]
class DeterministicStepComposeEngineGroupsPatch
{
public static readonly GameStateBuildEmitterEngine buildEngine = new GameStateBuildEmitterEngine();
public static readonly GameStateSimulationEmitterEngine simEngine = new GameStateSimulationEmitterEngine();
public static void Prefix(ref StateSyncRegistrationHelper stateSyncReg)
{
stateSyncReg.buildModeInitializationEngines.Add(buildEngine);
stateSyncReg.simulationModeInitializationEngines.Add(simEngine);
}
}
}