jkomoros / boardgame

An in-progress framework in golang to easily build boardgame Progressive Web Apps
Apache License 2.0
31 stars 4 forks source link

Some way for clients to know which moves are legal right now #772

Open jkomoros opened 4 years ago

jkomoros commented 4 years ago

Clients sometimes want to render buttons only if a move is currently legal right now in the game state. Sometimes they want to render the button if SOMEONE can currently run it, even if this user can't.

There's no good way to do that right now. Presumably it's something that ships down, for every move, whether it's legal right now if you pass this playerIndex, and also if you pass AdminPlayerIndex. The client can then decide to hide move buttons if no one, not even admin, can do it right now. And you'd only ship it down for a state bundle that is at the end of a run, not in the middle of animations.

... This could get expensive. #761 could start being way more important.

See also #768