public Deck(IDeckDescriptor <T> config) { _disposed = false; _cards = new List <T>(config.DeckSize); _shuffleData = new byte[1000]; _rng = new RNGCryptoServiceProvider(); BuildDeck(config.CardCounts, config.FillerCard); }
public static double Simulate <T>(IDeckDescriptor <T> des) { int successCount = 0; using (IDeck <T> deck = new Deck <T>(des)) { IHand <T> hand = new Hand <T>(deck); for (int i = 0; i < des.IterationCount; i++) { hand.Reset(); deck.Shuffle(); if (des.HasCombo(hand)) { successCount++; } } } return(100.0 * successCount / des.IterationCount); }