feat: 移动器新增 push 方法

This commit is contained in:
unanmed 2026-09-13 19:01:57 +08:00
parent ef58f79518
commit b86a060759
2 changed files with 13 additions and 2 deletions

View File

@ -330,6 +330,12 @@ export interface IObjectMover<T extends IObjectMovable> extends IHookable<
*/
animDir(dir: ObjectAnimDirection): this;
/**
* 直接在当前的移动规划后追加新的移动步
* @param steps 要追加的移动步
*/
push(steps: ObjectMoveStep[]): this;
/**
* 清空尚未执行的步骤队列
*/
@ -614,6 +620,11 @@ export abstract class ObjectMover<T extends IObjectMovable>
return this;
}
push(steps: ObjectMoveStep[]): this {
this.moveQueue.push(...steps);
return this;
}
clear(): this {
this.moveQueue.length = 0;
return this;

View File

@ -9,8 +9,8 @@ import {
} from './type';
export interface BuiltInFunction<
P extends Record<string, any>,
E extends Record<string, any>
P extends Record<string, any> = any,
E extends Record<string, any> = any
> {
name: string;
save?: boolean;