insertSplitOutcomes method
Implementation
void insertSplitOutcomes(
NodeOutput item, State state, TraverseQueue levelQueue) {
var queue = state.queue, outcomes = this.outcomes(item.id);
if (outcomes.length == 0) throw "split ${item.id} has no outcomes";
outcomes = List.from(outcomes);
String firstOutcomeId = outcomes.removeAt(0);
NodeInput first = this.node(firstOutcomeId);
queue.add(incomeId: item.id, bufferQueue: levelQueue, items: [
NodeInput(
id: first.id,
next: first.next,
)
]);
outcomes.forEach((String outcomeId) {
state.y++;
String id = "${item.id}-$outcomeId";
insertOrSkipNodeOnMatrix(
NodeOutput(
id: id,
next: [outcomeId],
anchorType: AnchorType.split,
anchorMargin: AnchorMargin.end,
orientation: AnchorOrientation.bottomLeft,
from: item.id,
to: outcomeId,
isAnchor: true,
renderIncomes: [item.id],
passedIncomes: [item.id],
childrenOnMatrix: 0,
),
state,
true,
);
NodeInput v = this.node(outcomeId);
queue.add(incomeId: id, bufferQueue: levelQueue, items: [v]);
});
}