hwoodward / Remote-Card-Games

Program for playing card games online/remotely. Goal is to play a game of hand and foot with multiple groups in different locations.
MIT License
2 stars 1 forks source link

discard logic -- make it more generic #44

Closed slwoodward closed 4 years ago

slwoodward commented 4 years ago

What won't the app do that you think it should? Please describe. A clear and concise description of what the goal is. Current discard logic assumes 1 card discarded unless zaephod. Good for Hand and Foot, but not all games.

Describe the solution you'd like A clear and concise description of what you want to happen. Let's move this to rules, so that there's a minimum and maximum number of cards discarded, based on conditions. EG - for hand and foot : maxDiscards = 1, minDiscards = 1 if len(currentHand) >0 , else minDiscards = 0. Currently maxDiscards and minDiscards do not exist as variables, the conditional, and the limits are all hard-coded. Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

hwoodward commented 4 years ago

So - after a request for comments from others we decided on the following behavior:

  1. UI confirms discard selection without any rule checking
  2. After confirmation the UI calls the controller's discard method
  3. The controller confirms the turn phase and will in the future use the ruleset in the client state to enforce the rules and then perform the discard

1 and 2 are done in the turn_phase merge, as along with the turn phase checking. The ruleset is not currently checked by the client_state.