22#include "../AIEditor/AIEditorGUI.h"
23#include "../AIEditor/AIEditorClipboard.h"
24#include "../AIGraphPlugin_BT/BTNodeRegistry.h"
25#include "../AIGraphPlugin_BT/BTGraphValidator.h"
26#include "../../NodeGraphCore/NodeGraphManager.h"
27#include "../../NodeGraphCore/GraphDocument.h"
28#include "../../NodeGraphCore/Commands/CreateNodeCommand.h"
43 std::cout <<
"[PASS] " <<
testName << std::endl;
46 std::cout <<
"[FAIL] " <<
testName << std::endl;
58 bool passed = (success ==
true) && (
editor.IsActive() ==
true);
95 GraphId id =
mgr.CreateGraph(
"AIGraph",
"BehaviorTree");
98 bool passed = (
id.value != 0) && (
doc !=
nullptr);
114 GraphId id =
mgr.CreateGraph(
"AIGraph",
"BehaviorTree");
115 mgr.SetActiveGraph(
id);
119 NodeId nodeId =
doc->CreateNode(
"BT_Selector", Vector2(100, 100));
121 bool passed = (
doc->GetNodes().size() == 1) && (
doc->GetNode(nodeId) !=
nullptr);
137 GraphId id =
mgr.CreateGraph(
"AIGraph",
"BehaviorTree");
138 mgr.SetActiveGraph(
id);
143 editor.GetCommandStack().ExecuteCommand(std::move(
cmd));
145 bool step1 = (
doc->GetNodes().size() == 1);
148 editor.GetCommandStack().Undo();
149 bool step2 = (
doc->GetNodes().size() == 0);
152 editor.GetCommandStack().Redo();
153 bool step3 = (
doc->GetNodes().size() == 1);
171 GraphId id =
mgr.CreateGraph(
"AIGraph",
"BehaviorTree");
172 mgr.SetActiveGraph(
id);
181 if (
msgIt->severity == BTValidationSeverity::Error) {
203 GraphId id =
mgr.CreateGraph(
"AIGraph",
"BehaviorTree");
204 mgr.SetActiveGraph(
id);
207 doc->CreateNode(
"BT_Action", Vector2(200, 200));
210 bool saved =
mgr.SaveGraph(
id,
"test_output.json");
235 bool step1 = (
mgr.GetAllGraphIds().size() == 2);
238 bool step2 = (
mgr.GetActiveGraphId().value ==
id1.value);
241 bool step3 = (
mgr.GetActiveGraphId().value ==
id2.value);
258 editor.MenuAction_ShowBlackboard();
276 editor.MenuAction_ShowNodePalette();
298 GraphId id =
mgr.CreateGraph(
"AIGraph",
"BehaviorTree");
299 mgr.SetActiveGraph(
id);
319 bool step4 = (
doc->GetNodes().size() == 4);
337 GraphId id =
mgr.CreateGraph(
"AIGraph",
"BehaviorTree");
338 mgr.SetActiveGraph(
id);
344 bool step1 = (
doc->GetNodes().size() == 2);
353 bool step3 = (
doc->GetNodes().size() == 1);
357 bool step4 = (
doc->GetNodes().size() == 2);
375 GraphId id =
mgr.CreateGraph(
"AIGraph",
"BehaviorTree");
376 mgr.SetActiveGraph(
id);
379 NodeId parent =
doc->CreateNode(
"BT_Selector", Vector2(100, 100));
440 GraphId id =
mgr.CreateGraph(
"AIGraph",
"BehaviorTree");
441 mgr.SetActiveGraph(
id);
445 bool step1 =
mgr.SaveGraph(
id,
"test_phase14.json");
453 bool step3 = (
doc2->GetNodes().size() == 1);
467 std::cout <<
"========================================" << std::endl;
468 std::cout <<
"AIEditorGUI Integration Tests (Phase 1.4)" << std::endl;
469 std::cout <<
"========================================" << std::endl;
470 std::cout << std::endl;
488 std::cout << std::endl;
489 std::cout <<
"========================================" << std::endl;
491 std::cout <<
"========================================" << std::endl;
ComponentTypeID GetComponentTypeID_Static()
void Test2_CreateNewBTGraph()
void Test13_ClipboardLinkPreservation()
void Test8_MultiGraphTabs()
void Test1_InitializeAIEditorGUI()
void Test9_BlackboardPanel()
void Test14_LayoutEngineNoOverlap()
void Test6_ValidateGraph()
void Test10_NodePaletteIntegration()
void Test11_ClipboardCopyPaste()
void Test3_LoadExistingBT()
void ReportTest(const std::string &testName, bool passed)
void Test7_SaveLoadRoundtrip()
void Test4_NodeCreationViaPalette()
void Test12_ClipboardCut()
void Test15_SaveLoadIntegration()
void Cut(const std::vector< NodeGraph::NodeId > &nodeIds, NodeGraph::GraphDocument *doc)
Cut selected nodes (copy + delete)
static AIEditorClipboard & Get()
Get singleton instance.
size_t GetNodeCount() const
Get number of nodes in clipboard.
void Copy(const std::vector< NodeGraph::NodeId > &nodeIds, NodeGraph::GraphDocument *doc)
Copy selected nodes to clipboard.
std::vector< NodeGraph::NodeId > Paste(NodeGraph::GraphDocument *doc, Vector pasteOffset)
Paste clipboard nodes into active graph.
bool IsEmpty() const
Check if clipboard has data.
Main AI Editor GUI class.
bool Initialize()
Initialize the editor.
static std::vector< BTValidationMessage > ValidateGraph(const NodeGraph::GraphDocument *graph)
Validate a complete BT graph.
Singleton registry for all BT node types.
static BTNodeRegistry & Get()
Get singleton instance.
Creates a new node in the graph.
Main document class for a node graph.
NodeId CreateNode(const std::string &nodeType, Vector2 pos)
Create a new node in the graph.
Singleton manager for multiple node graphs.
static NodeGraphManager & Get()
Get singleton instance.