Vixen
c7401864
csharp
public sealed class EventChain

A chain of dynamic events, walked into a shape a canvas can draw.

Read the guide page for this →

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> Events

    Every event, in address order.

  • public IReadOnlyList<EventChainEdge> Edges

    Every edge, in the order the events and their branches were authored.

  • public IReadOnlyList<EventChainEdge> TreeEdges

    The edges the walk drew as wires: one arriving at each event it reached.

  • public IReadOnlyList<EventChainEdge> BackEdges

    The edges it could not — a cycle closing, or a second way into an event.

  • public IReadOnlyList<EventChainEdge> Dangling

    Edges naming an event this build does not have.

  • public IReadOnlyList<DefId> Roots

    The events nothing leads to.

  • public IReadOnlyList<DefId> Entries

    Where the walk started: the roots, plus one per rootless component.

  • public IReadOnlyList<DefId> Order

    Every reachable event, in the order the walk found them.

  • public bool IsCyclic

    Whether anything in it leads back to something it came from.

Methods (2)

Used by (3)

  • EventChainProjectionVixen.Editor.Gameplay.Quests
  • EventChainProjectionTestsVixen.Editor.Gameplay.Quests.Tests
  • EventChainTestsVixen.Editor.Gameplay.Quests.Tests