LarsGast / DeckOfPlayingCards

Simple code to play with a standard deck of 52 cards
MIT License
0 stars 0 forks source link

Create your own deck #7

Closed LarsGast closed 1 year ago

LarsGast commented 1 year ago

Is your feature request related to a problem? Please describe. The user is limited to the standard deck of 52 cards. Being able to build your own deck (maybe even with your own cards) would give the user more freedom.

Describe the solution you'd like Add an optional parameter List<Card> cards = null to the Deck.get() method. If the value is null, create a standard deck. Otherwise, put the given cards into the deck.

Describe alternatives you've considered Being able to change the _cards property on the Deck class would give too much freedom and be counter intuitive, as this allows the user to change the deck at any moment. Adding a Deck.getStandardDeck() method could be added next to the existing method in the future. This would pave the way for other methods that get a certain deck of cards.

Additional context