Export all non-clue game actions, even after the game is won #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "timotree/deck-website:export-actions-after-win"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Prior to this change, there was a special case to avoid exporting any actions if the play stacks are complete. This has the unfortunate side effect that if a user has explicitly input any such play/discard actions, they are not captured in the page URL and therefore disappear upon refresh.
I believe the main motivation of the special case was to avoid exporting clue actions after a win (which are never explicitly input by the user anyway), but this is already accounted for in the
exportToJSONfunction, which omits all clue actions after the last play/discard.(This PR touches a line next to #2, so I based it on top of #2 and it must be merged afterwards.)
Empty slots in the hand are now represented by a `null` card. I carefully checked every use of `state.hand` to make sure this is accounted for properly. Fixes bugs where: - Styles are not removed when a card becomes an empty slot. - Importing a game crashes when it contains an action on a slot to the right of an empty slot. - Updating the DOM crashes when a player clues and the next player's leftmost slot is empty. - In order to fix this, I changed the default rank clue to be the highest rank, rather than the rank of their leftmost slot.WIP: Export all non-clue game actions, even after the game is wonto Export all non-clue game actions, even after the game is won