Files
esengine/packages/behavior-tree-editor/src/application/use-cases/RemoveConnectionUseCase.ts
T

28 lines
764 B
TypeScript
Raw Normal View History

import { CommandManager } from '@esengine/editor-runtime';
2025-11-03 21:22:16 +08:00
import { RemoveConnectionCommand } from '../commands/tree/RemoveConnectionCommand';
import { ITreeState } from '../commands/ITreeState';
/**
* 移除连接用例
*/
export class RemoveConnectionUseCase {
constructor(
private readonly commandManager: CommandManager,
private readonly treeState: ITreeState
) {}
/**
* 执行移除连接操作
*/
execute(from: string, to: string, fromProperty?: string, toProperty?: string): void {
const command = new RemoveConnectionCommand(
this.treeState,
from,
to,
fromProperty,
toProperty
);
this.commandManager.execute(command);
}
}