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

A way for players to start a game now #768

Open jkomoros opened 4 years ago

jkomoros commented 4 years ago

Originally captured in #755.

moves.WaitForEnoughPlayers currently fires as soon as MinNumPlayers are active and seated. But in some cases you want to allow the players to choose to wait for more players or get going.

A way for special players to say "It's OK to start". Maybe have it just be that WaitForEnoughPlayers checks, if Admin then it checks at least TargetCount, but if it's a player it lets them propose it before then? Or I guess you always need at least TargetCount to be legal to go, so maybe WaitForEnoughPlayers has a AllowPlayer() bool and if true then it only is legal if a player does it. (And update the logic of wilSeatPlayer in Legal, which currently just returns nil immediately)

Maybe only the very first (index 0) player can say it's OK to start. Or maybe all players can.

You also want a way for a "Start round" button to light up only when it's legal to fire that in the client. Ideally that button literally wouldn't even show except when it might be valid. (And only show enabled for players who are allowed to hit it)