|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
-
- namespace GamecraftModdingAPI.Utility
- {
- /// <summary>
- /// Utility to get the state of the current Gamecraft game
- /// </summary>
- public static class GameState
- {
- private static GameStateEngine gameEngine = new GameStateEngine();
-
- /// <summary>
- /// Is the game in edit mode?
- /// </summary>
- /// <returns>Whether the game is in build mode</returns>
- public static bool IsBuildMode()
- {
- return gameEngine.IsBuildMode();
- }
-
- /// <summary>
- /// Is the game in simulation mode?
- /// </summary>
- /// <returns>Whether the game is in simulation mode</returns>
- public static bool IsSimulationMode()
- {
- return gameEngine.IsSimulationMode();
- }
-
- /// <summary>
- /// Is a game loaded?
- /// </summary>
- /// <returns>Whether Gamecraft has a game open (false = Main Menu)</returns>
- public static bool IsInGame()
- {
- return gameEngine.IsInGame;
- }
-
- public static void Init()
- {
- GameEngineManager.AddGameEngine(gameEngine);
- }
- }
- }
|