actions reactored. multi-tick action support

This commit is contained in:
azykov@mail.ru
2026-06-12 11:46:42 +03:00
parent 36f76efdd7
commit 20a4edad5a
35 changed files with 1047 additions and 373 deletions
@@ -0,0 +1,16 @@
import { ScriptAction, type ScriptCoroutineContext } from "../../types";
export class WaitSecondsScriptAction extends ScriptAction {
private remaining: number;
constructor(coroutine: ScriptCoroutineContext, seconds: number) {
super(coroutine);
this.remaining = seconds;
}
public tick(deltaTime: number): boolean {
this.remaining -= deltaTime; // TODO should only consume as much time as needed and pass the remainder to next actions
return this.remaining <= 0;
}
}