Implementing persisting action result mutations

This commit is contained in:
Thaum Rystra
2024-04-02 17:46:31 +02:00
parent 2cbfc5d099
commit 1fb1eb83c7
15 changed files with 285 additions and 144 deletions

View File

@@ -17,14 +17,16 @@ export default async function applyTask(
action: EngineAction, task: PropTask | ItemAsAmmoTask, inputProvider: InputProvider
): Promise<void>
export default async function applyTask(
action: EngineAction, task: Task, inputProvider: InputProvider
): Promise<void | number>
export default async function applyTask(
action: EngineAction, task: Task, inputProvider: InputProvider
): Promise<void | number> {
// Pause and wait for the user if the action is being stepped through
console.log('applying task', action, inputProvider)
if (action._isSimulation && action._stepThrough && inputProvider.nextStep) {
console.log('waiting for next step resolution', task)
await inputProvider.nextStep(task);
}