This commit is contained in:
2025-05-26 17:04:33 +02:00
parent f0536f4129
commit 6bda371baa
303 changed files with 1361 additions and 1372 deletions

0
Runtime/Engine/Code/Main/EntryPoint.cs Normal file → Executable file
View File

0
Runtime/Engine/Code/Main/EntryPoint.cs.meta Normal file → Executable file
View File

19
Runtime/Engine/Code/Main/RR.cs Normal file → Executable file
View File

@@ -13,6 +13,10 @@ using UnityEngine.AddressableAssets;
using Assert = UnityEngine.Assertions.Assert;
using Logger = RebootKit.Engine.Foundation.Logger;
// RR
// Game
// GameMode
namespace RebootKit.Engine.Main {
public interface IGame : IDisposable {
UniTask InitAsync(CancellationToken cancellationToken);
@@ -33,7 +37,6 @@ namespace RebootKit.Engine.Main {
static DisposableBag s_disposableBag;
static DisposableBag s_servicesBag;
static DIContext s_diContext;
static ConsoleService s_consoleService;
static GameModesService s_gameModesService;
@@ -44,7 +47,6 @@ namespace RebootKit.Engine.Main {
public static InputService Input => s_inputService;
public static WorldService World => s_worldService;
public static GameModesService GameModes => s_gameModesService;
public static DIContext DIContext => s_diContext;
static IGame s_game;
@@ -57,13 +59,12 @@ namespace RebootKit.Engine.Main {
s_logger.Info("Initializing");
s_servicesBag = new DisposableBag();
s_disposableBag = new DisposableBag();
s_diContext = new DIContext();
s_logger.Debug("Registering core services");
s_consoleService = CreateService(s_engineConfigAsset.coreServices.consoleService);
s_inputService = CreateService(s_engineConfigAsset.coreServices.inputService);
s_worldService = CreateService(s_engineConfigAsset.coreServices.worldService);
s_gameModesService = CreateService(s_engineConfigAsset.coreServices.gameService);
s_gameModesService = CreateService<GameModesService>();
await InitializeAssetsAsync(cancellationToken);
@@ -134,15 +135,17 @@ namespace RebootKit.Engine.Main {
// Service API
public static TService CreateService<TService>(ServiceAsset<TService> asset) where TService : class, IService {
TService service = asset.Create(s_diContext);
s_diContext.Bind(service);
if (asset is null) {
throw new ArgumentNullException($"Null asset of type {typeof(TService)}");
}
TService service = asset.Create();
s_servicesBag.Add(service);
return service;
}
public static TService CreateService<TService>() where TService : class, IService {
TService service = s_diContext.Create<TService>();
s_diContext.Bind(service);
TService service = Activator.CreateInstance<TService>();
s_servicesBag.Add(service);
return service;
}

0
Runtime/Engine/Code/Main/RR.cs.meta Normal file → Executable file
View File