18#include "../system/system_utils.h"
22#include <unordered_set>
55 SYSTEM_LOG <<
"[VSEditor] Connection rejected: self-loop on node #"
64 for (
size_t i = 0;
i <
graph.Nodes.size(); ++
i)
75 SYSTEM_LOG <<
"[VSEditor] Connection rejected (Check A2a): destination node #"
76 <<
dstNodeID <<
" not found in template\n";
82 SYSTEM_LOG <<
"[VSEditor] Connection rejected (Check A2b): node type "
83 <<
static_cast<int>(
dstNode->Type)
84 <<
" does not accept exec-in connections\n";
91 for (
size_t i = 0;
i <
graph.ExecConnections.size(); ++
i)
96 SYSTEM_LOG <<
"[VSEditor] Connection rejected (Check B): pin "
98 <<
" already has an outgoing connection to node #"
111 std::map<int, std::vector<int> >
adj;
112 for (
size_t i = 0;
i <
graph.ExecConnections.size(); ++
i)
115 adj[
c.SourceNodeID].push_back(
c.TargetNodeID);
118 std::vector<int>
stack;
119 std::unordered_set<int>
visited;
121 while (!
stack.empty())
130 SYSTEM_LOG <<
"[VSEditor] Connection rejected: would create a cycle ("
137 for (
size_t j = 0;
j <
it->second.size(); ++
j)
ComponentTypeID GetComponentTypeID_Static()
Stateless validator for exec connections in Visual Script graphs (Phase 20-B).
Immutable, shareable task graph asset.
static bool IsExecConnectionValid(const TaskGraphTemplate &graph, int srcNodeID, const std::string &srcPinName, int dstNodeID)
Returns true if adding an exec connection from srcNodeID/srcPinName to dstNodeID would be valid (no s...
< Provides AssetID and INVALID_ASSET_ID
static bool NodeTypeAcceptsExecInput(TaskNodeType type)
TaskNodeType
Identifies the role of a node in the task graph.
@ GetBBValue
Data node – reads a Blackboard key.
@ MathOp
Data node – arithmetic operation (+, -, *, /)
@ EntryPoint
Unique entry node for VS graphs (replaces Root)
Explicit connection between a named exec-out pin of a source node and the exec-in pin of a target nod...
Full description of a single node in the task graph.