NorbiPeti
f403feb298
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
48 lines
1.3 KiB
C#
48 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;
|
|
}
|
|
}
|