2019-12-25 16:16:17 -05:00
|
|
|
|
using Svelto.ECS;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
using RobocraftX.SimulationModeState;
|
|
|
|
|
|
|
|
|
|
namespace GamecraftModdingAPI.Utility
|
|
|
|
|
{
|
|
|
|
|
class GameStateEngine : IApiEngine
|
|
|
|
|
{
|
|
|
|
|
public string Name { get; } = "GamecraftModdingAPIGameStateGameEngine";
|
|
|
|
|
|
2020-03-12 23:36:23 +01:00
|
|
|
|
public EntitiesDB entitiesDB { set; private get; }
|
2019-12-25 16:16:17 -05:00
|
|
|
|
|
|
|
|
|
private bool _isInGame = false;
|
|
|
|
|
|
|
|
|
|
public bool IsInGame { get { return _isInGame; } }
|
|
|
|
|
|
|
|
|
|
public void Dispose()
|
|
|
|
|
{
|
|
|
|
|
_isInGame = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Ready()
|
|
|
|
|
{
|
|
|
|
|
_isInGame = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool IsBuildMode()
|
|
|
|
|
{
|
2020-05-14 11:42:34 -04:00
|
|
|
|
return _isInGame && TimeRunningModeUtil.IsTimeStoppedMode(entitiesDB);
|
2019-12-25 16:16:17 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool IsSimulationMode()
|
|
|
|
|
{
|
2020-05-14 11:42:34 -04:00
|
|
|
|
return _isInGame && TimeRunningModeUtil.IsTimeRunningMode(entitiesDB);
|
2019-12-25 16:16:17 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|