Add new test and structural change version to chunk.

This commit is contained in:
2025-12-16 11:03:11 +09:00
parent 70cdd981aa
commit 7613b5087e
13 changed files with 463 additions and 80 deletions

View File

@@ -0,0 +1,68 @@
using Ghost.Test.Core;
using Misaki.HighPerformance.Jobs;
namespace Ghost.Entities.Test;
internal class SystemTest : ITest
{
private JobScheduler _jobScheduler = null!;
private World _world = null!;
public void Setup()
{
_jobScheduler = new JobScheduler(4);
_world = World.Create(_jobScheduler);
}
public void Run()
{
var group = _world.SystemManager.GetSystem<DefaultSystemGroup>();
group.AddSystem<TestSystemB>();
group.AddSystem<TestSystemA>();
group.SortSystems();
var api = new SystemAPI();
_world.SystemManager.InitializeAll(in api);
}
public void Cleanup()
{
_world.Dispose();
_jobScheduler.Dispose();
JobScheduler.ReleaseTempAllocator();
}
}
internal class TestSystemA : ISystem
{
public void Initialize(ref readonly SystemAPI systemAPI)
{
Console.WriteLine("TestSystemA Initialized");
}
public void Update(ref readonly SystemAPI systemAPI)
{
}
public void Cleanup(ref readonly SystemAPI systemAPI)
{
}
}
[UpdateAfter(typeof(TestSystemA))]
internal class TestSystemB : ISystem
{
public void Initialize(ref readonly SystemAPI systemAPI)
{
Console.WriteLine("TestSystemB Initialized");
}
public void Update(ref readonly SystemAPI systemAPI)
{
}
public void Cleanup(ref readonly SystemAPI systemAPI)
{
}
}