public sealed class EventChainA chain of dynamic events, walked into a shape a canvas can draw.
Remarks
⚠ An event chain is cyclic by design, and that is what decided this library's shape. Doc 28 says the chain graph is authored "on the existing node-graph host", and building it found that the host is the canvas and not Vixen.Editor.NodeGraph's document model. That model enforces three rules, and a chain breaks two of them: it refuses a cycle as the edge is made, and the camp being lost, retaken and lost again is the content rather than a mistake; and it gives an input one edge, while an event reached from two branches — a failure here, a success there — is ordinary authoring. Vixen.Editor.Ai reached the same conclusion from the other direction, for a tree.
So the chain is walked into a spanning tree, and everything the walk could not use is named rather than dropped. A depth-first walk from the entries wires each event once; every remaining edge is a BackEdges entry the projection draws as a labelled badge. Nothing is hidden and the picture stays a picture the canvas can lay out.
⚠ A chain with no roots still has entries. Two events that only lead to each other have no event with nothing pointing at it, and a walk that started only from roots would draw an empty canvas for a perfectly good chain. So a component with no root contributes its lowest-addressed event as an entry, which is arbitrary but stable — and stable is what a picture nobody wants to see rearrange itself needs.
Fields and properties (9)
public IReadOnlyList<DynamicEventTemplate> EventsEvery event, in address order.
public IReadOnlyList<EventChainEdge> EdgesEvery edge, in the order the events and their branches were authored.
public IReadOnlyList<EventChainEdge> TreeEdgesThe edges the walk drew as wires: one arriving at each event it reached.
public IReadOnlyList<EventChainEdge> BackEdgesThe edges it could not — a cycle closing, or a second way into an event.
public IReadOnlyList<EventChainEdge> DanglingEdges naming an event this build does not have.
public IReadOnlyList<DefId> RootsThe events nothing leads to.
public IReadOnlyList<DefId> EntriesWhere the walk started: the roots, plus one per rootless component.
public IReadOnlyList<DefId> OrderEvery reachable event, in the order the walk found them.
public bool IsCyclicWhether anything in it leads back to something it came from.
Methods (2)
public DynamicEventTemplate? Find(DefId id)An event by id.
public static EventChain Build(QuestLibrary library)Builds the chain of everything in a library.
Used by (3)
- EventChainProjectionVixen.Editor.Gameplay.Quests
- EventChainProjectionTestsVixen.Editor.Gameplay.Quests.Tests
- EventChainTestsVixen.Editor.Gameplay.Quests.Tests