Refactor alot of stuff

This commit is contained in:
2026-10-29 22:54:29 +01:00
parent c23b666ee4
commit 260abc2c98
138 changed files with 2835 additions and 466 deletions
@@ -22,6 +22,16 @@ namespace KernelPanic.Combat
/// <summary>Bounded persistent work, advanced only by the authoritative Interpret phase.</summary>
public sealed class GoroutineScheduler
{
// Explicit checkpoint values: no gameplay hooks or random draws during restoration.
internal GoroutineSchedulerValues CaptureValues() => new()
{
_nextId = _nextId,
};
internal void RestoreValues(GoroutineSchedulerValues value)
{
_nextId = value._nextId;
}
public const int Capacity = 3, MaximumTicks = 5;
private readonly List<Goroutine> _active = new();
private long _nextId;
@@ -65,5 +75,7 @@ namespace KernelPanic.Combat
return true;
}
public void Clear() { foreach (var work in _active.ToArray()) Terminate(work); }
internal void RestoreActive(IEnumerable<Goroutine> active)
{ _active.Clear(); _active.AddRange(active); }
}
}