A stable modding interface between Techblox and mods https://mod.exmods.org/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DeterministicStepComposeEngineGroupsPatch.cs 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Reflection;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using Harmony;
  8. using Svelto.ECS;
  9. using RobocraftX.Common;
  10. using RobocraftX.StateSync;
  11. using GamecraftModdingAPI.Utility;
  12. namespace GamecraftModdingAPI.Events
  13. {
  14. /// <summary>
  15. /// Patch of RobocraftX.StateSync.DeterministicStepCompositionRoot.ComposeEnginesGroups(...)
  16. /// </summary>
  17. //[HarmonyPatch(typeof(DeterministicStepCompositionRoot), "DeterministicCompose")]
  18. [HarmonyPatch]
  19. class GameHostTransitionDeterministicGroupEnginePatch
  20. {
  21. public static readonly GameStateBuildEmitterEngine buildEngine = new GameStateBuildEmitterEngine();
  22. public static readonly GameStateSimulationEmitterEngine simEngine = new GameStateSimulationEmitterEngine();
  23. public static void Postfix()
  24. {
  25. //stateSyncReg.buildModeInitializationEngines.Add(buildEngine);
  26. //stateSyncReg.simulationModeInitializationEngines.Add(simEngine);
  27. //enginesRoot.AddEngine(buildEngine);
  28. //enginesRoot.AddEngine(simEngine);
  29. buildEngine.EmitIfBuildMode();
  30. simEngine.EmitIfSimMode();
  31. }
  32. [HarmonyTargetMethod]
  33. public static MethodBase TargetMethod(HarmonyInstance harmonyInstance)
  34. {
  35. return AccessTools.Method(AccessTools.TypeByName("RobocraftX.StateSync.GameHostTransitionDeterministicGroupEngine"), "EndTransition");
  36. //.MakeGenericMethod(typeof(CosmeticEnginesSequenceBuildOrder), typeof(CosmeticEnginesSequenceSimOrder), typeof(DeterministicToCosmeticSyncBuildOrder), typeof(DeterministicToCosmeticSyncSimOrder));
  37. }
  38. }
  39. }