|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- 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.Common;
- using RobocraftX.StateSync;
-
- using GamecraftModdingAPI.Utility;
-
- namespace GamecraftModdingAPI.Events
- {
- /// <summary>
- /// Patch of RobocraftX.StateSync.DeterministicStepCompositionRoot.ComposeEnginesGroups(...)
- /// </summary>
- //[HarmonyPatch(typeof(DeterministicStepCompositionRoot), "DeterministicCompose")]
- [HarmonyPatch]
- class GameHostTransitionDeterministicGroupEnginePatch
- {
-
- public static readonly GameStateBuildEmitterEngine buildEngine = new GameStateBuildEmitterEngine();
-
- public static readonly GameStateSimulationEmitterEngine simEngine = new GameStateSimulationEmitterEngine();
-
- public static void Postfix()
- {
- //stateSyncReg.buildModeInitializationEngines.Add(buildEngine);
- //stateSyncReg.simulationModeInitializationEngines.Add(simEngine);
- //enginesRoot.AddEngine(buildEngine);
- //enginesRoot.AddEngine(simEngine);
- buildEngine.EmitIfBuildMode();
- simEngine.EmitIfSimMode();
- }
-
- [HarmonyTargetMethod]
- public static MethodBase TargetMethod(HarmonyInstance harmonyInstance)
- {
- return AccessTools.Method(AccessTools.TypeByName("RobocraftX.StateSync.GameHostTransitionDeterministicGroupEngine"), "EndTransition");
- //.MakeGenericMethod(typeof(CosmeticEnginesSequenceBuildOrder), typeof(CosmeticEnginesSequenceSimOrder), typeof(DeterministicToCosmeticSyncBuildOrder), typeof(DeterministicToCosmeticSyncSimOrder));
- }
- }
- }
|