Closed Wulfheart closed 3 years ago
First of all, the State type also has an Options function that returns all options for all provinces for a given nation. It might be useful for you, if nothing else as an example.
Second, move orders are valid for destinations that need a convoy, which is why they return those options. If you don't want that I guess it would be possible to patch the code somehow, but I don't have a plan ready for that.
So this behavior is desired?
So s.Options() will return the same result like the other one?
From the move options I’d like to get an indication if a province is reachable by convoy or by normal movement. Is that possible with a little workaround? One option could be to go through the graph and rule all out which are not adjacent but this feels not right.
In diplicity it is, yes - I don't see why it wouldn't be.
Yes, State.Options just handles the iterations over provinces and order types.
I'm sure it could be handled somehow, but why?
But state.Options
has the signature func (self *State) Options(orders []godip.Order, nation godip.Nation) (result godip.Options)
which is different from the signature of state.Phase().Options
which is func (Phase) Options(Validator, Nation) Options
.
What does belong in the []godip.Orders
?
Ah, sorry - it doesn't automatically pick order types - it just iterates over provinces and the provided orders. Maybe it wasn't such a help after all :/
Ok. Thank you.
Given the following setup function:
I would expect the
s.Phase().Options(s, godip.France)[godip.Province("wal")][godip.OrderType["Move"]
to contain only the orders for the provinces which are reachable without a convoy. Currently I can't see a way to distinguish between convoy-movements and normal movements. E.g. it is possible in this case to move from wal to lon with and without convoy from eng. Do you know a solution for this problem?