Skip to content

Commit 1788c03

Browse files
💾 Feat(Workflow): 添加 IWorkflowEditorBridge 接口以支持 BlueprintEditor 和 WorkflowEditor 之间的通信
1 parent dd7a554 commit 1788c03

2 files changed

Lines changed: 42 additions & 0 deletions

File tree

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System.Collections.Generic;
2+
3+
namespace KitX.Core.Contract.Workflow;
4+
5+
/// <summary>
6+
/// Bridge interface for communication between BlueprintEditor and WorkflowEditor.
7+
/// BlueprintEditor always runs in association with a WorkflowEditor instance.
8+
/// </summary>
9+
public interface IWorkflowEditorBridge
10+
{
11+
/// <summary>
12+
/// Gets the current BlockScript source code from the WorkflowEditor's main program area
13+
/// </summary>
14+
string? GetCurrentScript();
15+
16+
/// <summary>
17+
/// Gets the current helper functions list from the WorkflowEditor
18+
/// </summary>
19+
List<HelperFunction>? GetHelperFunctions();
20+
21+
/// <summary>
22+
/// Writes BlockScript source code back to the WorkflowEditor's main program area
23+
/// and triggers UI update
24+
/// </summary>
25+
void SetScript(string sourceCode, List<HelperFunction>? helpers);
26+
27+
/// <summary>
28+
/// Appends output text to the WorkflowEditor's Output panel
29+
/// </summary>
30+
void AppendOutput(string output);
31+
32+
/// <summary>
33+
/// Triggers script execution in the WorkflowEditor
34+
/// </summary>
35+
void TriggerExecution();
36+
}

KitX Core Contracts/KitX.Core.Contract/Workflow/IWorkflowService.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ public interface IBlockScriptService
118118
/// </summary>
119119
BlockScriptValidationResult ValidateBlockScript(string sourceCode);
120120

121+
/// <summary>
122+
/// Parses constants from a BlockScript source's #ConstBlock section.
123+
/// Only returns variables that have initial values (DefaultValue != null).
124+
/// </summary>
125+
List<VariableConstant> ParseConstantsFromBlockScript(string sourceCode);
126+
121127
/// <summary>
122128
/// Executes a block script
123129
/// </summary>

0 commit comments

Comments
 (0)