Fork me on GitHub
#fulcro
<
2024-06-10
>
Braden Shepherdson23:06:06

I'm working on a platform for board games. simple games are straightforward - each player selects from a set of legal moves when it's their turn (eg. one card from their hand; one chess move). but in more complex games (think Wingspan, Terraforming Mars, Dominion) you can end up in a complex, multi-step "wizard" kind of workflow, which should allow you to backtrack and change earlier decisions up until the final commit. (for example, in TM there are different ways to pay for a card you want to play; then it might require choosing another player to lose some items; then choose where to place a city on the board.) the part I'd be glad of advice and pointers on is: this feels like a job for some kind of state machines, but I'm not sure if it needs the full power of statecharts or if the built in ones will serve. there's often nested states: some card has a sequence of effects which take place in order, some of those effects require a decision to go to all players in order, or all in parallel, etc. etc.

Brett14:06:57

Certainly sound like state machines to me. Since it sounds like it goes beyond UI I tend to think you'd rather go directly to state charts