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.

44 lines
932B

  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. namespace GamecraftModdingAPI.Utility
  9. {
  10. class GameStateEngine : IApiEngine
  11. {
  12. public string Name { get; } = "GamecraftModdingAPIGameStateGameEngine";
  13. public EntitiesDB entitiesDB { set; private get; }
  14. private bool _isInGame = false;
  15. public bool IsInGame { get { return _isInGame; } }
  16. public void Dispose()
  17. {
  18. _isInGame = false;
  19. }
  20. public void Ready()
  21. {
  22. _isInGame = true;
  23. }
  24. public bool IsBuildMode()
  25. {
  26. return _isInGame && SimModeUtil.IsBuildMode(entitiesDB);
  27. }
  28. public bool IsSimulationMode()
  29. {
  30. return _isInGame && SimModeUtil.IsSimulationMode(entitiesDB);
  31. }
  32. }
  33. }