TechbloxModdingAPI/GamecraftModdingAPI/Utility/GameState.cs
2019-12-25 16:16:17 -05:00

49 lines
1.3 KiB
C#

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);
}
}
}