TechbloxModdingAPI/GamecraftModdingAPI/App/GameBuildSimEventEngine.cs
Norbi Peti f403feb298 Update to Gamecraft 2020.06.17.08.41 (preview)
Removed BlockIdentifiers.OWNED_BLOCKS as the original got replaced with an array
Added the correct group for each supported functional block
Removed EntityFactory property from IEntitySerializer as it is provided on deserialization
2020-07-11 00:30:58 +02:00

49 lines
1.3 KiB
C#

using System;
using RobocraftX.Common;
using RobocraftX.StateSync;
using Svelto.ECS;
using Unity.Jobs;
using GamecraftModdingAPI.Engines;
using GamecraftModdingAPI.Utility;
namespace GamecraftModdingAPI.App
{
public class GameBuildSimEventEngine : IApiEngine, IUnorderedInitializeOnTimeRunningModeEntered, IUnorderedInitializeOnTimeStoppedModeEntered
{
public event EventHandler<GameEventArgs> SimulationMode;
public event EventHandler<GameEventArgs> BuildMode;
public string Name => "GamecraftModdingAPIBuildSimEventGameEngine";
public bool isRemovable => false;
public EntitiesDB entitiesDB { set; private get; }
public void Dispose() { }
public void Ready() { }
public JobHandle OnInitializeTimeRunningMode(JobHandle inputDeps)
{
ExceptionUtil.InvokeEvent(SimulationMode, this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder });
return inputDeps;
}
public JobHandle OnInitializeTimeStoppedMode(JobHandle inputDeps)
{
ExceptionUtil.InvokeEvent(BuildMode, this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder });
return inputDeps;
}
}
public struct GameEventArgs
{
public string GameName;
public string GamePath;
}
}