2020-05-22 01:00:33 +00:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
using Svelto.ECS;
|
|
|
|
|
|
|
|
|
|
namespace GamecraftModdingAPI.Utility
|
|
|
|
|
{
|
|
|
|
|
public static class AsyncUtils
|
|
|
|
|
{
|
|
|
|
|
private static AsyncUtilsEngine gameEngine = new AsyncUtilsEngine();
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Waits for entity submission asynchronously.
|
2020-05-27 15:20:53 +00:00
|
|
|
|
/// Use after placing a block or otherwise creating things in the game to access their properties.
|
2020-05-22 01:00:33 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
public static async Task WaitForSubmission()
|
|
|
|
|
{
|
|
|
|
|
await gameEngine.WaitForSubmission();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void Setup(EnginesRoot enginesRoot)
|
|
|
|
|
{
|
|
|
|
|
gameEngine.Setup(enginesRoot.GenerateEntityFunctions(), enginesRoot.GenerateEntityFactory());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void Init()
|
|
|
|
|
{
|
|
|
|
|
GameEngineManager.AddGameEngine(gameEngine);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|