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.

49 lines
1.3KB

  1. using System;
  2. using RobocraftX.Common;
  3. using RobocraftX.StateSync;
  4. using Svelto.ECS;
  5. using Unity.Jobs;
  6. using GamecraftModdingAPI.Engines;
  7. using GamecraftModdingAPI.Utility;
  8. namespace GamecraftModdingAPI.App
  9. {
  10. public class GameBuildSimEventEngine : IApiEngine, IUnorderedInitializeOnTimeRunningModeEntered, IUnorderedInitializeOnTimeStoppedModeEntered
  11. {
  12. public event EventHandler<GameEventArgs> SimulationMode;
  13. public event EventHandler<GameEventArgs> BuildMode;
  14. public string Name => "GamecraftModdingAPIBuildSimEventGameEngine";
  15. public bool isRemovable => false;
  16. public EntitiesDB entitiesDB { set; private get; }
  17. public void Dispose() { }
  18. public void Ready() { }
  19. public JobHandle OnInitializeTimeRunningMode(JobHandle inputDeps)
  20. {
  21. ExceptionUtil.InvokeEvent(SimulationMode, this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder });
  22. return inputDeps;
  23. }
  24. public JobHandle OnInitializeTimeStoppedMode(JobHandle inputDeps)
  25. {
  26. ExceptionUtil.InvokeEvent(BuildMode, this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder });
  27. return inputDeps;
  28. }
  29. }
  30. public struct GameEventArgs
  31. {
  32. public string GameName;
  33. public string GamePath;
  34. }
  35. }