Require majority to approve reset game
Love this game! Would be very interested in learning rust and contributing! 💯
This shouldn't be too hard to implement -- we'd need to keep track of the players who have requested a reset. I'd probably prefer requiring two over requiring a majority, though -- less complicated for the players to coordinate.
Changes we'd need to make:
-
add an
Option<PlayerID>field to the draw/exchange/play states to store the player ID of the person who initially attempted to reset the game -
add logic to set the the field to
Some(requester_id)if it isNone -
add logic to only reset the game if the field is
Some(original_requester_id)whereoriginal_requester_id != requester_id -
add an
Actionvariant representing a reset-game-request-cancellation -
Add a UI component which shows that someone is trying to reset the game, and provides other players the opportunity to acknowledge. Also, provide a way to "unset" the requested game reset for the player who initially requested it