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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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 HarmonyLib;
  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. [Obsolete]
  19. [HarmonyPatch]
  20. class GameHostTransitionDeterministicGroupEnginePatch
  21. {
  22. public static readonly GameStateBuildEmitterEngine buildEngine = new GameStateBuildEmitterEngine();
  23. public static readonly GameStateSimulationEmitterEngine simEngine = new GameStateSimulationEmitterEngine();
  24. public static void Postfix()
  25. {
  26. //stateSyncReg.buildModeInitializationEngines.Add(buildEngine);
  27. //stateSyncReg.simulationModeInitializationEngines.Add(simEngine);
  28. //enginesRoot.AddEngine(buildEngine);
  29. //enginesRoot.AddEngine(simEngine);
  30. buildEngine.EmitIfBuildMode();
  31. simEngine.EmitIfSimMode();
  32. }
  33. [HarmonyTargetMethod]
  34. public static MethodBase TargetMethod(Harmony harmonyInstance)
  35. {
  36. return AccessTools.Method(AccessTools.TypeByName("RobocraftX.StateSync.GameHostTransitionDeterministicGroupEngine"), "EndTransition");
  37. //.MakeGenericMethod(typeof(CosmeticEnginesSequenceBuildOrder), typeof(CosmeticEnginesSequenceSimOrder), typeof(DeterministicToCosmeticSyncBuildOrder), typeof(DeterministicToCosmeticSyncSimOrder));
  38. }
  39. }
  40. }