Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request - Allow to specify next phase using a function #954

Closed
johwic opened this issue Jul 11, 2021 · 1 comment · Fixed by #972
Closed

Feature Request - Allow to specify next phase using a function #954

johwic opened this issue Jul 11, 2021 · 1 comment · Fixed by #972

Comments

@johwic
Copy link

johwic commented Jul 11, 2021

Problem: Currently the next field in the phase configuration only accepts a string.

I'm trying to write a phase using the TurnOrder.ONCE turn order, however the next phase needs to be determined dynamically. The only way to do this as far as I know is to specify an endIf function, but this clashes with automatic phase-ending TurnOrder.ONCE. I could write such a function, but especially since endIf is called before the phase is even begun, in my case the logic to accomplish this gets unnecesarily convoluted. It would be convenient if the next field accepted a function to allow to determine the next phase dynamically, without interfering with phase-ending logic.

@delucis
Copy link
Member

delucis commented Jul 12, 2021

Sounds like a good idea!

You could use the default turn order with an endIf that returns { next }, but as you mention that can easily require extra logic and we could support this more cleanly using your suggested approach.

@delucis delucis added this to To do in To-do via automation Jul 12, 2021
To-do automation moved this from To do to Done Aug 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
To-do
Done
Development

Successfully merging a pull request may close this issue.

2 participants