Implement scheduling system with parallel execution support and dummy job systems
This commit is contained in:
@@ -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; }
|
||||
}
|
||||
Reference in New Issue
Block a user