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 System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace TechbloxModdingAPI.Utility
  7. {
  8. /// <summary>
  9. /// Utility to get the state of the current Techblox game
  10. /// </summary>
  11. public static class GameState
  12. {
  13. private static GameStateEngine gameEngine = new GameStateEngine();
  14. /// <summary>
  15. /// Is the game in edit mode?
  16. /// </summary>
  17. /// <returns>Whether the game is in build mode</returns>
  18. public static bool IsBuildMode()
  19. {
  20. return gameEngine.IsBuildMode();
  21. }
  22. /// <summary>
  23. /// Is the game in simulation mode?
  24. /// </summary>
  25. /// <returns>Whether the game is in simulation mode</returns>
  26. public static bool IsSimulationMode()
  27. {
  28. return gameEngine.IsSimulationMode();
  29. }
  30. /// <summary>
  31. /// Is a game loaded?
  32. /// </summary>
  33. /// <returns>Whether Techblox has a game open (false = Main Menu)</returns>
  34. public static bool IsInGame()
  35. {
  36. return gameEngine.IsInGame;
  37. }
  38. public static void Init()
  39. {
  40. GameEngineManager.AddGameEngine(gameEngine);
  41. }
  42. }
  43. }