12 if (NodesEnteredWithThisStep.Contains(
this))
15 TEXT(
"SelectorNode::HandleNodeEnter - Failed to enter selector node, it was entered multiple times in a single step."
16 "Theoretically with some condition magic it could make sense, but chances are that it is an endless loop,"
17 "thus entering the same selector twice with a single step is not supported. Dialogue is terminated.\nContext:\n\t%s"),
23 NodesEnteredWithThisStep.Add(
this);
31 if (Edge.Evaluate(Context, {this}))
32 return Context.
EnterNode(Edge.TargetIndex, NodesEnteredWithThisStep);
40 TArray<int32> Candidates;
41 for (int32 EdgeIndex = 0; EdgeIndex <
Children.Num(); ++EdgeIndex)
42 if (
Children[EdgeIndex].Evaluate(Context, {
this }))
43 Candidates.Add(EdgeIndex);
46 if (Candidates.Num() == 0)
50 const int32 SelectedIndex = FMath::RandHelper(Candidates.Num());
51 const int32 TargetNodeIndex =
Children[Candidates[SelectedIndex]].TargetIndex;
52 return Context.
EnterNode(TargetNodeIndex, NodesEnteredWithThisStep);
60 TEXT(
"HandleNodeEnter - selector node entered, no satisfied child.\nContext:\n\t%s"),
bool EnterNode(int32 NodeIndex, TSet< const UDlgNode * > NodesEnteredWithThisStep)
FString GetContextString() const
UFUNCTION(BlueprintPure, Category = "Dialogue|Context")
TArray< FDlgEdge > Children
UPROPERTY(VisibleAnywhere, EditFixedSize, AdvancedDisplay, Category = "Dialogue|Node")