49 lines
1.2 KiB
C#
49 lines
1.2 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()
|
|||
|
{
|
|||
|
ExceptionUtil.InvokeEvent(SimulationMode, this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder });
|
|||
|
return default(JobHandle);
|
|||
|
}
|
|||
|
|
|||
|
public JobHandle OnInitializeTimeStoppedMode()
|
|||
|
{
|
|||
|
ExceptionUtil.InvokeEvent(BuildMode, this, new GameEventArgs { GameName = GameMode.SaveGameDetails.Name, GamePath = GameMode.SaveGameDetails.Folder });
|
|||
|
return default(JobHandle);
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public struct GameEventArgs
|
|||
|
{
|
|||
|
public string GameName;
|
|||
|
|
|||
|
public string GamePath;
|
|||
|
}
|
|||
|
}
|