bgreenawald / madgab-online

1 stars 0 forks source link

Refactors review state flow #16

Closed bgreenawald closed 4 years ago

bgreenawald commented 4 years ago

This PR changes the workflow surrounding the REVIEW state. It makes some non-backward compatible API changes.

  1. New endpoint end_active_state (previously called end_turn): This endpoint is called when the final clue has been guessed or the time has run out. It ends the active state, applies the time bonus, and transitions to the REVIEW state.
  2. Renamed endpoint end_turn (previously called change_turn): This endpoint is called when the users have finished their review. It can lead to one of three states:
    • STEALING if any clues were missed.
    • OVER if all clues were guessed and the game is in a valid game end state.
    • IDLE otherwise.
  3. Change of behavior for endpoint steal: The stealing endpoint will now lead to one of two states:
    • OVER if the game is in a valid end state after stealing is applied.
    • IDLE otherwise.

If this lines up with the desired workflow, this branch is safe to merge.