Betdraw reimplemented (mostly) using the new deck implementation

This commit is contained in:
Kwoth
2022-07-22 17:36:43 +02:00
parent 39fc21d41c
commit c20b851dc7
5 changed files with 87 additions and 13 deletions

View File

@@ -39,13 +39,16 @@ public abstract class NewDeck<TCard, TSuit, TValue>
return null;
}
public virtual TCard? Peek()
=> _cards.First?.Value;
public virtual void Shuffle()
{
var cards = _cards.ToList();
cards.Shuffle();
var newCards = cards.Shuffle();
_cards.Clear();
foreach (var card in cards)
foreach (var card in newCards)
_cards.AddFirst(card);
}
}