mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-02 14:19:15 +00:00
LibCards+Games: Return ErrorOr from deck-creation factory functions :^)
Also, be smarter about appending cards to the deck: we can unchecked_append them to the deck, since we already ensured enough capacity earlier.
This commit is contained in:
parent
0855e9f014
commit
c7c4d70f6e
Notes:
sideshowbarker
2024-07-17 09:47:09 +09:00
Author: https://github.com/AtkinsSJ
Commit: c7c4d70f6e
Pull-request: https://github.com/SerenityOS/serenity/pull/17103
Reviewed-by: https://github.com/linusg
5 changed files with 15 additions and 14 deletions
|
@ -131,8 +131,8 @@ 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);
|
||||
ErrorOr<NonnullRefPtrVector<Card>> create_standard_deck(Shuffle);
|
||||
ErrorOr<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>&);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue