Implement scheduling system with parallel execution support and dummy job systems

This commit is contained in:
max
2026-08-07 12:14:02 +02:00
parent a0f2713fdc
commit 0132c1326d
14 changed files with 844 additions and 5 deletions
@@ -0,0 +1,37 @@
using MoonTools.ECS;
namespace Nerfed.Runtime.Scheduling;
public sealed class SystemScheduleEntry
{
public SystemScheduleEntry(
MoonTools.ECS.System system,
SystemSchedulePhase phase,
string[] dependsOn,
int registrationIndex)
{
System = system;
Phase = phase;
DependsOn = dependsOn ?? Array.Empty<string>();
RegistrationIndex = registrationIndex;
if (system is IParallelSystemMetadata metadata)
{
Name = metadata.ScheduleName;
Access = metadata.AccessDeclaration;
}
else
{
Name = system.GetType().Name;
// Unknown systems are treated as structural to preserve safety until metadata is declared.
Access = new SystemAccessDeclaration(new ComponentAccess(typeof(object), SystemAccessMode.StructuralWrite));
}
}
public MoonTools.ECS.System System { get; }
public string Name { get; }
public SystemSchedulePhase Phase { get; }
public string[] DependsOn { get; }
public int RegistrationIndex { get; }
public SystemAccessDeclaration Access { get; }
}