mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 06:17:34 +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:
parent
1d533acbc0
commit
46299f3853
5 changed files with 64 additions and 42 deletions
|
@ -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<>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue