ECS refactor: new ComponentSet, serialization, generators
Major ECS API overhaul: added ComponentSet, refactored ComponentRegistry, and updated all entity/component creation methods. Introduced robust custom serialization infrastructure and per-component source generators for registration and (de)serialization. Updated editor, engine, and test code to use new APIs. Improved code quality, naming, and performance throughout. Removed obsolete code and updated dependencies.
This commit is contained in:
@@ -1,57 +0,0 @@
|
||||
using Ghost.SparseEntities;
|
||||
|
||||
namespace Ghost.Engine.Services;
|
||||
|
||||
internal static class PlayerLoopService
|
||||
{
|
||||
private static bool _isRunning = false;
|
||||
|
||||
// TODO: Implement the actual time system
|
||||
public static float fixedDeltaTime = 0.02f;
|
||||
|
||||
public static void Start()
|
||||
{
|
||||
if (_isRunning)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (var i = 0; i < World.WorldCount; i++)
|
||||
{
|
||||
var world = World.GetWorld(i);
|
||||
|
||||
foreach (var script in world.QueryScript())
|
||||
{
|
||||
script.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Update()
|
||||
{
|
||||
for (var i = 0; i < World.WorldCount; i++)
|
||||
{
|
||||
var world = World.GetWorld(i);
|
||||
world.SystemStorage.UpdateSystems();
|
||||
|
||||
foreach (var script in world.QueryScript())
|
||||
{
|
||||
script.Update();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Shutdown()
|
||||
{
|
||||
for (var i = 0; i < World.WorldCount; i++)
|
||||
{
|
||||
var world = World.GetWorld(i);
|
||||
foreach (var script in world.QueryScript())
|
||||
{
|
||||
script.OnDestroy();
|
||||
}
|
||||
}
|
||||
|
||||
_isRunning = false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user