Skip to content

Add context arguments to all delayed task methods#129

Merged
Kasekopf merged 7 commits intoloathers:mainfrom
Kasekopf:context
Apr 3, 2025
Merged

Add context arguments to all delayed task methods#129
Kasekopf merged 7 commits intoloathers:mainfrom
Kasekopf:context

Conversation

@Kasekopf
Copy link
Member

@Kasekopf Kasekopf commented Mar 22, 2025

This PR adds a "context" produced by the Engine that can be consumed by all of the methods on a task (ready, completed, delayed combat macros, etc.). Contexts are designed to be computed once per task execution, and can be used for tasks to consider global state when needed.

This could be used to avoid globals like the globalStateCache in loopstar, or to store mine state in oreo.

Typescript is pretty cool about the Void type, so I think this is basically entirely backwards compatible for grimoire scripts.

@Kasekopf Kasekopf merged commit b922be3 into loathers:main Apr 3, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants