-
-
Couldn't load subscription status.
- Fork 114
Feature/ecs behavior tree #188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
🧪 CI InsightsHere'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
Show autofix suggestion
Hide autofix suggestion
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.
| @@ -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'); |
| 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
Show autofix suggestion
Hide autofix suggestion
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.
| @@ -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'; | ||
|
|
| 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
Show autofix suggestion
Hide autofix suggestion
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.
-
Copy modified line R6
| @@ -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'; |
No description provided.