![]() |
Olympe Engine 2.0
2D Game Engine with ECS Architecture
|
Immutable, shareable task graph asset. More...
#include <TaskGraphTemplate.h>
Collaboration diagram for Olympe::TaskGraphTemplate:Public Member Functions | |
| bool | Validate () const |
| Validates the structural integrity of the template. | |
| const TaskNodeDefinition * | GetNode (int32_t nodeId) const |
| Returns a pointer to the node with the given ID, or nullptr. | |
| void | BuildLookupCache () |
| Rebuilds the internal ID-to-node lookup map from the Nodes vector. | |
| int | SanitizeExecConnections () |
| Phase 24.3 - Poka-Yoke: Sanitizes exec connections to remove invalid links. | |
Public Attributes | |
| std::string | Name |
| Friendly name of this template (e.g. "PatrolBehaviour") | |
| std::string | Description |
| Optional human-readable description. | |
| std::vector< VariableDefinition > | LocalVariables |
| Blackboard schema. | |
| std::vector< TaskNodeDefinition > | Nodes |
| All graph nodes. | |
| int32_t | RootNodeID = NODE_INDEX_NONE |
| ID of the root node (must exist in Nodes) | |
| int32_t | EntryPointID = NODE_INDEX_NONE |
| ID of the EntryPoint node (for VS graphs) | |
| std::string | GraphType = "BehaviorTree" |
| Graph type: "BehaviorTree" (legacy) or "VisualScript" (ATS VS) | |
| std::vector< BlackboardEntry > | Blackboard |
| Local blackboard declared in this graph. | |
| std::vector< ExecPinConnection > | ExecConnections |
| Explicit exec connections (ATS VS only) | |
| std::vector< DataPinConnection > | DataConnections |
| Explicit data connections (ATS VS only) | |
| bool | IsSubGraph = false |
| True if this template is a SubGraph. | |
| std::vector< SubGraphParameterDef > | InputParameters |
| Declared inputs (for subgraphs) | |
| std::vector< SubGraphParameterDef > | OutputParameters |
| Declared outputs (for subgraphs) | |
| std::vector< ConditionPreset > | Presets |
| Presets are now stored in the graph JSON, not in external files. | |
| json | GlobalVariableValues = json::object() |
| Stores JSON representation of global variable values for this specific graph instance. | |
Private Attributes | |
| std::unordered_map< int32_t, const TaskNodeDefinition * > | m_nodeLookup |
| Fast lookup: node ID -> pointer into Nodes vector. | |
Immutable, shareable task graph asset.
Load once, share across many TaskRunner instances. Call BuildLookupCache() after populating Nodes so that GetNode() runs in O(1). Call Validate() before using the template to catch structural errors early.
Definition at line 178 of file TaskGraphTemplate.h.
| void Olympe::TaskGraphTemplate::BuildLookupCache | ( | ) |
Rebuilds the internal ID-to-node lookup map from the Nodes vector.
Must be called after Nodes is populated or modified.
Definition at line 81 of file TaskGraphTemplate.cpp.
References GetComponentTypeID_Static(), m_nodeLookup, Name, Nodes, and SYSTEM_LOG.
Referenced by Olympe::BTtoVSMigrator::Convert(), Olympe::VisualScriptEditorPanel::LoadTemplate(), and Olympe::VisualScriptEditorPanel::SyncTemplateFromCanvas().
Here is the call graph for this function:
Here is the caller graph for this function:| const TaskNodeDefinition * Olympe::TaskGraphTemplate::GetNode | ( | int32_t | nodeId | ) | const |
Returns a pointer to the node with the given ID, or nullptr.
Requires BuildLookupCache() to have been called after the last modification to Nodes.
| nodeId | Node identifier. |
Definition at line 71 of file TaskGraphTemplate.cpp.
References GetComponentTypeID_Static(), and m_nodeLookup.
Referenced by Olympe::VisualScriptEditorPanel::RebuildLinks(), Olympe::VisualScriptEditorPanel::RemoveLink(), and Olympe::GraphRuntimeInstance::StepExecution().
Here is the call graph for this function:
Here is the caller graph for this function:| int Olympe::TaskGraphTemplate::SanitizeExecConnections | ( | ) |
Phase 24.3 - Poka-Yoke: Sanitizes exec connections to remove invalid links.
Detects and removes exec connections that violate the data-pure node constraints:
Logs all removed connections to SYSTEM_LOG for debugging. Safe to call multiple times (idempotent).
Definition at line 98 of file TaskGraphTemplate.cpp.
References ExecConnections, Olympe::GetBBValue, GetComponentTypeID_Static(), Olympe::MathOp, Nodes, and SYSTEM_LOG.
Here is the call graph for this function:| bool Olympe::TaskGraphTemplate::Validate | ( | ) | const |
Validates the structural integrity of the template.
Rules checked:
Definition at line 21 of file TaskGraphTemplate.cpp.
References Olympe::TaskNodeDefinition::ChildrenIDs, GetComponentTypeID_Static(), Name, Nodes, RootNodeID, and SYSTEM_LOG.
Here is the call graph for this function:| std::vector<BlackboardEntry> Olympe::TaskGraphTemplate::Blackboard |
Local blackboard declared in this graph.
Definition at line 200 of file TaskGraphTemplate.h.
Referenced by Olympe::VariablePropertyPanel::RebuildVariableList(), Olympe::VariablePropertyPanel::Render(), Olympe::VisualScriptEditorPanel::RenderForEachNodeProperties(), Olympe::VisualScriptEditorPanel::RenderSubGraphNodeProperties(), Olympe::SetBBValuePropertyPanel::RenderValueInput(), Olympe::GetBBValuePropertyPanel::RenderVariableInfo(), Olympe::VisualScriptEditorPanel::RunGraphSimulation(), Olympe::VisualScriptEditorPanel::SerializeAndWrite(), and Olympe::VisualScriptEditorPanel::ValidateAndCleanBlackboardEntries().
| std::vector<DataPinConnection> Olympe::TaskGraphTemplate::DataConnections |
Explicit data connections (ATS VS only)
Definition at line 206 of file TaskGraphTemplate.h.
Referenced by Olympe::VisualScriptEditorPanel::RebuildLinks(), Olympe::VisualScriptEditorPanel::RunGraphSimulation(), Olympe::VisualScriptEditorPanel::SerializeAndWrite(), and Olympe::VisualScriptEditorPanel::TraceUpstreamDataNodes().
| std::string Olympe::TaskGraphTemplate::Description |
Optional human-readable description.
Definition at line 186 of file TaskGraphTemplate.h.
| int32_t Olympe::TaskGraphTemplate::EntryPointID = NODE_INDEX_NONE |
ID of the EntryPoint node (for VS graphs)
Definition at line 194 of file TaskGraphTemplate.h.
Referenced by Olympe::VisualScriptEditorPanel::AddNode(), Olympe::BTtoVSMigrator::Convert(), Olympe::VisualScriptEditorPanel::RunGraphSimulation(), and Olympe::GraphRuntimeInstance::StartExecution().
| std::vector<ExecPinConnection> Olympe::TaskGraphTemplate::ExecConnections |
Explicit exec connections (ATS VS only)
Definition at line 203 of file TaskGraphTemplate.h.
Referenced by Olympe::BTtoVSMigrator::Convert(), Olympe::VisualScriptEditorPanel::RebuildLinks(), Olympe::VisualScriptEditorPanel::RunGraphSimulation(), SanitizeExecConnections(), and Olympe::VisualScriptEditorPanel::SerializeAndWrite().
| json Olympe::TaskGraphTemplate::GlobalVariableValues = json::object() |
Stores JSON representation of global variable values for this specific graph instance.
These are entity-specific values (different from global registry defaults). Loaded from "globalVariableValues" in graph JSON during deserialization. Restored to EntityBlackboard after initialization.
Definition at line 224 of file TaskGraphTemplate.h.
Referenced by Olympe::VisualScriptEditorPanel::LoadTemplate(), Olympe::VisualScriptEditorPanel::Save(), Olympe::VisualScriptEditorPanel::SaveAs(), and Olympe::VisualScriptEditorPanel::SerializeAndWrite().
| std::string Olympe::TaskGraphTemplate::GraphType = "BehaviorTree" |
Graph type: "BehaviorTree" (legacy) or "VisualScript" (ATS VS)
Definition at line 197 of file TaskGraphTemplate.h.
Referenced by Olympe::BTtoVSMigrator::Convert().
| std::vector<SubGraphParameterDef> Olympe::TaskGraphTemplate::InputParameters |
Declared inputs (for subgraphs)
Definition at line 210 of file TaskGraphTemplate.h.
True if this template is a SubGraph.
Definition at line 209 of file TaskGraphTemplate.h.
| std::vector<VariableDefinition> Olympe::TaskGraphTemplate::LocalVariables |
Blackboard schema.
Definition at line 188 of file TaskGraphTemplate.h.
|
private |
Fast lookup: node ID -> pointer into Nodes vector.
Definition at line 277 of file TaskGraphTemplate.h.
Referenced by BuildLookupCache(), and GetNode().
| std::string Olympe::TaskGraphTemplate::Name |
Friendly name of this template (e.g. "PatrolBehaviour")
Definition at line 185 of file TaskGraphTemplate.h.
Referenced by BuildLookupCache(), Olympe::BTtoVSMigrator::Convert(), Olympe::VisualScriptEditorPanel::Initialize(), Olympe::VisualScriptEditorPanel::LoadTemplate(), Olympe::VisualScriptEditorPanel::RenderNodePropertiesPanelContent(), Olympe::VisualScriptEditorPanel::RenderSwitchNodeProperties(), Olympe::VisualScriptEditorPanel::RunGraphSimulation(), Olympe::VisualScriptEditorPanel::SerializeAndWrite(), and Validate().
| std::vector<TaskNodeDefinition> Olympe::TaskGraphTemplate::Nodes |
All graph nodes.
Definition at line 189 of file TaskGraphTemplate.h.
Referenced by BuildLookupCache(), Olympe::BTtoVSMigrator::Convert(), Olympe::VisualScriptEditorPanel::EvaluateDataNode(), Olympe::VisualScriptEditorPanel::Initialize(), Olympe::VisualScriptEditorPanel::RenderForEachNodeProperties(), Olympe::VisualScriptEditorPanel::RenderNodePropertiesPanelContent(), Olympe::VisualScriptEditorPanel::RenderSubGraphNodeProperties(), Olympe::VisualScriptEditorPanel::RenderSwitchNodeProperties(), Olympe::VisualScriptEditorPanel::RunGraphSimulation(), SanitizeExecConnections(), Olympe::VisualScriptEditorPanel::Save(), Olympe::VisualScriptEditorPanel::SerializeAndWrite(), Olympe::VisualScriptEditorPanel::SyncCanvasFromTemplate(), Olympe::VisualScriptEditorPanel::SyncEditorNodesFromTemplate(), Olympe::VisualScriptEditorPanel::SyncNodePositionsFromImNodes(), Olympe::VisualScriptEditorPanel::SyncTemplateFromCanvas(), Olympe::VisualScriptEditorPanel::TraceUpstreamDataNodes(), and Validate().
| std::vector<SubGraphParameterDef> Olympe::TaskGraphTemplate::OutputParameters |
Declared outputs (for subgraphs)
Definition at line 211 of file TaskGraphTemplate.h.
| std::vector<ConditionPreset> Olympe::TaskGraphTemplate::Presets |
Presets are now stored in the graph JSON, not in external files.
This makes blueprints self-contained with no external file dependencies. Populated during LoadTemplate() from "presets" array in graph JSON.
Definition at line 217 of file TaskGraphTemplate.h.
Referenced by Olympe::VisualScriptEditorPanel::Initialize(), Olympe::VisualScriptEditorPanel::LoadTemplate(), Olympe::VisualScriptEditorPanel::SerializeAndWrite(), and Olympe::VisualScriptEditorPanel::SyncPresetsFromRegistryToTemplate().
| int32_t Olympe::TaskGraphTemplate::RootNodeID = NODE_INDEX_NONE |
ID of the root node (must exist in Nodes)
Definition at line 191 of file TaskGraphTemplate.h.
Referenced by Olympe::VisualScriptEditorPanel::AddNode(), Olympe::BTtoVSMigrator::Convert(), Olympe::VisualScriptEditorPanel::RunGraphSimulation(), Olympe::GraphRuntimeInstance::StartExecution(), and Validate().