1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 06:57:45 +00:00

LibCards+Games: Move "create a deck" logic to LibCards

`create_standard_deck()` is the usual 52-card deck, but more custom
setups (such as Spider's multiples-of-one-suit) can be created by
passing suit counts to `create_deck()`.
This commit is contained in:
Sam Atkins 2022-09-28 11:35:12 +01:00 committed by Sam Atkins
parent 1d533acbc0
commit 46299f3853
5 changed files with 64 additions and 42 deletions

View file

@ -123,6 +123,14 @@ private:
bool m_inverted { false };
};
enum class Shuffle {
No,
Yes,
};
NonnullRefPtrVector<Card> create_standard_deck(Shuffle);
NonnullRefPtrVector<Card> create_deck(unsigned full_club_suit_count, unsigned full_diamond_suit_count, unsigned full_heart_suit_count, unsigned full_spade_suit_count, Shuffle);
void shuffle_deck(NonnullRefPtrVector<Card>&);
}
template<>