In the "field.selectedCard"-workflow.
Rules.canDragCard is only tested once, and only when selecting the card.
This property persists throughout "animations"(auto moves) and even "New Game".
Consequences are:
1 you can remove a "field.selectedCard" from the suitStack (even when covered by other cards)
2 you can move a stack violating the stacking rules (unorderd stack of cards) from the freshly started game anywhere -- provided the receiving card/cell supports it
3 you can even move an "unordered stack of cards" on top of itself -- if the stack contains a card that supports receiving the "field.selectedCard"
NB: 1,3 lead to an unsupported state where the game no longer reacts to user input
Possible remedies:
unselect "field.selectedCard" on any occasion that might provoke the above situations (animations, New Game)
check "Rules.canDragCard(field.selectedCard)" (again) before finalizing the move (for both drop-targets: cards and cells)
In the "field.selectedCard"-workflow. Rules.canDragCard is only tested once, and only when selecting the card. This property persists throughout "animations"(auto moves) and even "New Game". Consequences are: 1 you can remove a "field.selectedCard" from the suitStack (even when covered by other cards) 2 you can move a stack violating the stacking rules (unorderd stack of cards) from the freshly started game anywhere -- provided the receiving card/cell supports it 3 you can even move an "unordered stack of cards" on top of itself -- if the stack contains a card that supports receiving the "field.selectedCard"
NB: 1,3 lead to an unsupported state where the game no longer reacts to user input
Possible remedies:
I'm working on a pull-request...