shengji icon indicating copy to clipboard operation
shengji copied to clipboard

Require majority to approve reset game

Open dingwilson opened this issue 5 years ago • 1 comments

Love this game! Would be very interested in learning rust and contributing! 💯

dingwilson avatar Apr 23 '20 05:04 dingwilson

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:

  1. 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

  2. add logic to set the the field to Some(requester_id) if it is None

  3. add logic to only reset the game if the field is Some(original_requester_id) where original_requester_id != requester_id

  4. add an Action variant representing a reset-game-request-cancellation

  5. 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

rbtying avatar Apr 23 '20 15:04 rbtying