TechbloxModdingAPI/GamecraftModdingAPI/Events/DeterministicStepComposeEngineGroupsPatch.cs

48 lines
1.6 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;
2020-05-03 19:31:09 +00:00
using HarmonyLib;
using Svelto.ECS;
2020-04-07 17:05:00 +00:00
using RobocraftX.Common;
using RobocraftX.StateSync;
using GamecraftModdingAPI.Utility;
namespace GamecraftModdingAPI.Events
{
/// <summary>
/// Patch of RobocraftX.StateSync.DeterministicStepCompositionRoot.ComposeEnginesGroups(...)
/// </summary>
2020-04-07 17:05:00 +00:00
//[HarmonyPatch(typeof(DeterministicStepCompositionRoot), "DeterministicCompose")]
2020-08-03 02:39:26 +00:00
[Obsolete]
[HarmonyPatch]
2020-04-07 17:05:00 +00:00
class GameHostTransitionDeterministicGroupEnginePatch
{
public static readonly GameStateBuildEmitterEngine buildEngine = new GameStateBuildEmitterEngine();
public static readonly GameStateSimulationEmitterEngine simEngine = new GameStateSimulationEmitterEngine();
2020-04-07 17:05:00 +00:00
public static void Postfix()
{
2020-04-07 17:05:00 +00:00
//stateSyncReg.buildModeInitializationEngines.Add(buildEngine);
//stateSyncReg.simulationModeInitializationEngines.Add(simEngine);
//enginesRoot.AddEngine(buildEngine);
//enginesRoot.AddEngine(simEngine);
buildEngine.EmitIfBuildMode();
simEngine.EmitIfSimMode();
}
2020-04-07 17:05:00 +00:00
[HarmonyTargetMethod]
2020-05-03 19:31:09 +00:00
public static MethodBase TargetMethod(Harmony harmonyInstance)
2020-04-07 17:05:00 +00:00
{
return AccessTools.Method(AccessTools.TypeByName("RobocraftX.StateSync.GameHostTransitionDeterministicGroupEngine"), "EndTransition");
//.MakeGenericMethod(typeof(CosmeticEnginesSequenceBuildOrder), typeof(CosmeticEnginesSequenceSimOrder), typeof(DeterministicToCosmeticSyncBuildOrder), typeof(DeterministicToCosmeticSyncSimOrder));
}
}
}