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

Get all possible orders for a unit #119

Closed
Wulfheart opened this issue Nov 28, 2020 · 7 comments
Closed

Get all possible orders for a unit #119

Wulfheart opened this issue Nov 28, 2020 · 7 comments

Comments

@Wulfheart
Copy link
Contributor

How can I retrieve all possible orders for a unit based on a given state?

I found out, that the Phase interface has a methods Options. But I'm unsure what validator means. Is this even the way to go for?

@zond
Copy link
Owner

zond commented Nov 28, 2020

State implements Validator, so just provide the state if you have it :)

@Wulfheart
Copy link
Contributor Author

Wulfheart commented Nov 28, 2020

Ah, ok 💡

I'm a little bit confused by the recursive nature of the options. What is the reason to implement it that way?

@zond
Copy link
Owner

zond commented Nov 28, 2020

They are both a bit overdesigned (to handle all kinds of order types and combinations, and support JSON serialization), and a bit of a hack, so that's understandable :O

Best bet is probably to create a scenario and then look at what the options contain, and get an intuition for what it means.

@Wulfheart
Copy link
Contributor Author

But how can I get the difference between a support move and a support hold order?

@zond
Copy link
Owner

zond commented Nov 28, 2020

Support hold has the same province twice in a row at the end, while a support move has supported source/supported target.

@Wulfheart
Copy link
Contributor Author

Ok. This feels wild.

@zond
Copy link
Owner

zond commented Nov 28, 2020

🦍

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

No branches or pull requests

2 participants