Class OrderedHookList<T>
- Namespace
- WorldgenLib
- Assembly
- WorldgenLib.VintageStory.dll
Generic ordered-delegate registry. Each step holds a sorted list of (order, index, delegate) tuples. Frozen after initWorldGen.
public sealed class OrderedHookList<T> where T : class
Type Parameters
T
- Inheritance
-
OrderedHookList<T>
- Inherited Members
Properties
Count
Number of registered delegates.
public int Count { get; }
Property Value
HasDisabledRegistrations
Whether at least one registration has been disabled.
public bool HasDisabledRegistrations { get; }
Property Value
IsFrozen
Whether the list is frozen.
public bool IsFrozen { get; }
Property Value
Snapshot
Return the frozen ordered entries without allocating. This is the path used by terrain and BlockLayers hot loops. The returned span remains valid until this list is discarded; entries are immutable.
public ReadOnlySpan<OrderedHookList<T>.HookEntry> Snapshot { get; }
Property Value
Methods
Disable(string)
Disable all registrations owned by a mod after an invocation failure. This implements the per-hook failure boundary without mutating the sorted delegate array used by the worldgen hot path.
public bool Disable(string modId)
Parameters
modIdstring
Returns
Enumerate()
Iterate delegates in frozen order. Throws if not frozen.
public IEnumerable<(double Order, string ModId, T Delegate)> Enumerate()
Returns
Freeze()
Freeze the list. After this, no more registrations are allowed. Delegates are sorted by (order, registration index) for stable order.
public void Freeze()
GetRegistrationReport()
List registered effects for the startup report.
public IReadOnlyList<(double Order, string ModId)> GetRegistrationReport()
Returns
IsDisabled(string)
Check disabled state without allocating or taking a lock.
public bool IsDisabled(string modId)
Parameters
modIdstring
Returns
Register(string, double, T)
Register a delegate. Throws if frozen (after initWorldGen).
public void Register(string modId, double order, T handler)