Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
VSConnectionValidator.h
Go to the documentation of this file.
1/**
2 * @file VSConnectionValidator.h
3 * @brief Stateless validator for exec connections in Visual Script graphs (Phase 20-B).
4 * @author Olympe Engine
5 * @date 2026-03-13
6 *
7 * @details
8 * VSConnectionValidator provides static validation helpers that are called
9 * from VisualScriptEditorPanel::RenderCanvas() before creating a new exec
10 * connection via ConnectExec(). The validator is intentionally stateless so
11 * that it can be called directly from unit tests without requiring ImGui or
12 * ImNodes context.
13 *
14 * C++14 compliant — no std::optional, structured bindings, std::filesystem,
15 * std::string_view.
16 */
17
18#pragma once
19
20#include "../TaskSystem/TaskGraphTemplate.h"
21#include <string>
22
23namespace Olympe {
24
25/**
26 * @class VSConnectionValidator
27 * @brief Stateless validator for exec connections in VS graphs.
28 *
29 * @details
30 * All methods are static. The class holds no state.
31 *
32 * C++14 compliant.
33 */
35{
36public:
37 /**
38 * @brief Returns true if adding an exec connection from srcNodeID/srcPinName
39 * to dstNodeID would be valid (no self-loop, no duplicate output pin,
40 * no cycle).
41 * Logs the rejection reason via SYSTEM_LOG if returning false.
42 *
43 * @param graph The current graph template to validate against.
44 * @param srcNodeID Source node identifier.
45 * @param srcPinName Source exec-out pin name (e.g. "Out", "Then").
46 * @param dstNodeID Destination node identifier.
47 * @return true The connection is valid and may be created.
48 * @return false The connection would produce an invalid graph state.
49 */
51 int srcNodeID,
52 const std::string& srcPinName,
53 int dstNodeID);
54};
55
56} // namespace Olympe
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
Immutable, shareable task graph asset.
Stateless validator for exec connections in VS graphs.
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