TechbloxModdingAPI/GamecraftModdingAPI/Utility/GameStateEngine.cs

48 lines
1,013 B
C#
Raw Normal View History

using Svelto.ECS;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RobocraftX.SimulationModeState;
2020-05-12 00:28:26 +00:00
using GamecraftModdingAPI.Engines;
namespace GamecraftModdingAPI.Utility
{
class GameStateEngine : IApiEngine
{
public string Name { get; } = "GamecraftModdingAPIGameStateGameEngine";
public EntitiesDB entitiesDB { set; private get; }
private bool _isInGame = false;
public bool IsInGame { get { return _isInGame; } }
2020-05-12 00:28:26 +00:00
public bool isRemovable => false;
public void Dispose()
{
_isInGame = false;
}
public void Ready()
{
_isInGame = true;
}
public bool IsBuildMode()
{
2020-05-14 15:42:34 +00:00
return _isInGame && TimeRunningModeUtil.IsTimeStoppedMode(entitiesDB);
}
public bool IsSimulationMode()
{
2020-05-14 15:42:34 +00:00
return _isInGame && TimeRunningModeUtil.IsTimeRunningMode(entitiesDB);
}
}
}