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.

47 lines
1009B

  1. using Svelto.ECS;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using RobocraftX.SimulationModeState;
  8. using TechbloxModdingAPI.Engines;
  9. namespace TechbloxModdingAPI.Utility
  10. {
  11. class GameStateEngine : IApiEngine
  12. {
  13. public string Name { get; } = "TechbloxModdingAPIGameStateGameEngine";
  14. public EntitiesDB entitiesDB { set; private get; }
  15. private bool _isInGame = false;
  16. public bool IsInGame { get { return _isInGame; } }
  17. public bool isRemovable => false;
  18. public void Dispose()
  19. {
  20. _isInGame = false;
  21. }
  22. public void Ready()
  23. {
  24. _isInGame = true;
  25. }
  26. public bool IsBuildMode()
  27. {
  28. return _isInGame && TimeRunningModeUtil.IsTimeStoppedMode(entitiesDB);
  29. }
  30. public bool IsSimulationMode()
  31. {
  32. return _isInGame && TimeRunningModeUtil.IsTimeRunningMode(entitiesDB);
  33. }
  34. }
  35. }