summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCards
AgeCommit message (Collapse)Author
2021-07-21LibGfx: Use "try_" prefix for static factory functionsAndreas Kling
Also mark them as [[nodiscard]].
2021-06-24LibCards: Support non-alternating colour patience gamesJamie Mansfield
This introduces a new MovementType concept to LibCards, starting the process to allow other patience games to be implemented using it - that differ more substantially from Klondike in logic. This is currently used for two purposes: 1. to verify that the 'grabbed' stack of cards is valid* (sequential and correct colours) and 2. to allow 'grabbed' stacks to be pushed onto same-colour, either-colour, or alternating-colour stacks * Klondike doesn't need this logic, as per how the game works any 'grabbed' selection is guaranteed to be valid.
2021-06-04LibCards: Draw card stack background when the entire stack is movingTimothy Flynn
The stack background should be painted when the entire stack is being dragged, rather than just the top card. Fixes #7786. Regressed in 2b762ef94075b8a6e1ae8dd61e535b6b6cf7c064.
2021-06-04Solitaire+LibCards: Draw card stacks with rounded cornersTimothy Flynn
Now that the cards have rounded corners, draw the stack box behind the cards with rounded corners as well. This way, the corner of the stack box doesn't peek out from behind the cards. The caveat here is that the "play" card stack now needs to hold a reference to the "waste" stack beneath it so it knows when not to draw its background on top of the waste stack. To faciliate that, the array of card stacks is now a NonnullRefPtrVector so the play stack can store a smart pointer to the waste stack (instead of a raw pointer or reference).
2021-06-04LibCards: Don't draw the first card smaller than the othersGunnar Beutner
2021-06-03LibCards: Draw cards with rounded card cornersDavid Isaksson
closes #7412
2021-05-26Hearts: Highlight cards when an invalid play is attemptedGunnar Beutner
This briefly inverts the selected card when the user attempts to make an invalid play.
2021-05-22LibCards: Fix alignment for the card labelsGunnar Beutner
Previously the code didn't take into account that the label for the "10" card is larger than for the other cards.
2021-05-22LibCards: Correct a spelling mistakeGunnar Beutner
2021-05-21Games: Add HeartsGunnar Beutner
2021-05-21Solitaire: Move cards functionality into LibCardsGunnar Beutner