Skip to content

Conversation

@esengine
Copy link
Owner

No description provided.

@codecov
Copy link

codecov bot commented Oct 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@mergify
Copy link

mergify bot commented Oct 20, 2025

🧪 CI Insights

Here's what we observed from your CI run for b568217.

🟢 All jobs passed!

But CI Insights is watching 👀

* ```
*/
static async saveToFile(rootEntity: Entity, filePath: string): Promise<void> {
const json = this.toJSON(rootEntity, true);

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable json.

Copilot Autofix

AI 9 days ago

To fix the problem, we should remove the unused variable json on line 95 inside the saveToFile function. This entails simply deleting the line:

const json = this.toJSON(rootEntity, true);

since it is not referenced by any following code and its only purpose would be for the commented-out code, which does not count as active code. No other code in this method relies on json.

There is only one change needed: delete that line from saveToFile. No new imports, definitions, or edits elsewhere are required.


Suggested changeset 1
packages/behavior-tree/src/Serialization/BehaviorTreePersistence.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/packages/behavior-tree/src/Serialization/BehaviorTreePersistence.ts b/packages/behavior-tree/src/Serialization/BehaviorTreePersistence.ts
--- a/packages/behavior-tree/src/Serialization/BehaviorTreePersistence.ts
+++ b/packages/behavior-tree/src/Serialization/BehaviorTreePersistence.ts
@@ -92,7 +92,6 @@
      * ```
      */
     static async saveToFile(rootEntity: Entity, filePath: string): Promise<void> {
-        const json = this.toJSON(rootEntity, true);
 
         // 需要在 Tauri 环境中使用
         // const { writeTextFile } = await import('@tauri-apps/api/fs');
EOF
@@ -92,7 +92,6 @@
* ```
*/
static async saveToFile(rootEntity: Entity, filePath: string): Promise<void> {
const json = this.toJSON(rootEntity, true);

// 需要在 Tauri 环境中使用
// const { writeTextFile } = await import('@tauri-apps/api/fs');
Copilot is powered by AI and may make mistakes. Always verify output.
import { Entity, IScene } from '@esengine/ecs-framework';
import { BehaviorTreeNode } from './Components/BehaviorTreeNode';
import { CompositeNodeComponent } from './Components/CompositeNodeComponent';
import { DecoratorNodeComponent } from './Components/DecoratorNodeComponent';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import DecoratorNodeComponent.

Copilot Autofix

AI 8 days ago

The solution is to remove the unused import statement for DecoratorNodeComponent from line 4 in packages/behavior-tree/src/BehaviorTreeBuilder.ts. This does not impact any other parts of the code since the rest of the class and its methods do not reference it (per provided context). No additional imports or code modifications are necessary: just delete that one import line for clarity and maintainability.


Suggested changeset 1
packages/behavior-tree/src/BehaviorTreeBuilder.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/packages/behavior-tree/src/BehaviorTreeBuilder.ts b/packages/behavior-tree/src/BehaviorTreeBuilder.ts
--- a/packages/behavior-tree/src/BehaviorTreeBuilder.ts
+++ b/packages/behavior-tree/src/BehaviorTreeBuilder.ts
@@ -1,7 +1,6 @@
 import { Entity, IScene } from '@esengine/ecs-framework';
 import { BehaviorTreeNode } from './Components/BehaviorTreeNode';
 import { CompositeNodeComponent } from './Components/CompositeNodeComponent';
-import { DecoratorNodeComponent } from './Components/DecoratorNodeComponent';
 import { BlackboardComponent } from './Components/BlackboardComponent';
 import { NodeType, CompositeType, DecoratorType, BlackboardValueType } from './Types/TaskStatus';
 
EOF
@@ -1,7 +1,6 @@
import { Entity, IScene } from '@esengine/ecs-framework';
import { BehaviorTreeNode } from './Components/BehaviorTreeNode';
import { CompositeNodeComponent } from './Components/CompositeNodeComponent';
import { DecoratorNodeComponent } from './Components/DecoratorNodeComponent';
import { BlackboardComponent } from './Components/BlackboardComponent';
import { NodeType, CompositeType, DecoratorType, BlackboardValueType } from './Types/TaskStatus';

Copilot is powered by AI and may make mistakes. Always verify output.
import { CompositeNodeComponent } from './Components/CompositeNodeComponent';
import { DecoratorNodeComponent } from './Components/DecoratorNodeComponent';
import { BlackboardComponent } from './Components/BlackboardComponent';
import { NodeType, CompositeType, DecoratorType, BlackboardValueType } from './Types/TaskStatus';

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused import DecoratorType.

Copilot Autofix

AI 8 days ago

To fix the problem, simply remove DecoratorType from the named import list on line 6. This change should be made in the file packages/behavior-tree/src/BehaviorTreeBuilder.ts on the line that currently imports NodeType, CompositeType, DecoratorType, BlackboardValueType from ./Types/TaskStatus. Make sure that only DecoratorType is removed, leaving any still-used imports intact. No other code changes are required.

Suggested changeset 1
packages/behavior-tree/src/BehaviorTreeBuilder.ts

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/packages/behavior-tree/src/BehaviorTreeBuilder.ts b/packages/behavior-tree/src/BehaviorTreeBuilder.ts
--- a/packages/behavior-tree/src/BehaviorTreeBuilder.ts
+++ b/packages/behavior-tree/src/BehaviorTreeBuilder.ts
@@ -3,7 +3,7 @@
 import { CompositeNodeComponent } from './Components/CompositeNodeComponent';
 import { DecoratorNodeComponent } from './Components/DecoratorNodeComponent';
 import { BlackboardComponent } from './Components/BlackboardComponent';
-import { NodeType, CompositeType, DecoratorType, BlackboardValueType } from './Types/TaskStatus';
+import { NodeType, CompositeType, BlackboardValueType } from './Types/TaskStatus';
 
 // 导入动作组件
 import { WaitAction } from './Components/Actions/WaitAction';
EOF
@@ -3,7 +3,7 @@
import { CompositeNodeComponent } from './Components/CompositeNodeComponent';
import { DecoratorNodeComponent } from './Components/DecoratorNodeComponent';
import { BlackboardComponent } from './Components/BlackboardComponent';
import { NodeType, CompositeType, DecoratorType, BlackboardValueType } from './Types/TaskStatus';
import { NodeType, CompositeType, BlackboardValueType } from './Types/TaskStatus';

// 导入动作组件
import { WaitAction } from './Components/Actions/WaitAction';
Copilot is powered by AI and may make mistakes. Always verify output.
@esengine esengine merged commit 009f8af into master Oct 27, 2025
8 checks passed
@esengine esengine deleted the feature/ecs-behavior-tree branch October 27, 2025 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants