private CardSet GetSeenCards(Game game, bool showdown) { CardSet seen_cards = new CardSet(); if (showdown) { foreach (Card card in game.DealerHand) { seen_cards.Add(card); } } else { seen_cards.Add(game.DealerHand[0]); } foreach (Hand hand in game.PlayerHandSet) { if (hand.IsSplit()) continue; foreach (Card card in hand) { seen_cards.Add(card); } } return seen_cards; }
private CardSet GetSeenCards(Game game, bool showdown) { CardSet seen_cards = new CardSet(); if (showdown) { foreach (Card card in game.DealerHand) { seen_cards.Add(card); } } else { seen_cards.Add(game.DealerHand[0]); } foreach (Hand hand in game.PlayerHandSet) { if (hand.IsSplit()) { continue; } foreach (Card card in hand) { seen_cards.Add(card); } } return(seen_cards); }
public static CardSet operator +(CardSet set1, CardSet set2) { CardSet tmp = new CardSet(set1); tmp.Add(set2); return tmp; }
public static CardSet operator +(CardSet set1, CardSet set2) { CardSet tmp = new CardSet(set1); tmp.Add(set2); return(tmp); }
public object Clone() { CardSet cloned_set = new CardSet(); foreach (Card card in this.card_set) { cloned_set.Add((Card)(card.Clone())); } return(cloned_set); }
public void ResetShoe() { shoe.Clear(); int decks = rules.Decks; for (int i = 0; i < decks; i++) { shoe.Add(CardsFactory.StandardDeck); } shoe.Shuffle(random); agent.ResetShoe(this); }
public CardSet ExtractTop(int count) { CardSet set = new CardSet(); for (int i = 0; i < count; i++) { if (card_set.Count == 0) { break; } set.Add(ExtractTop()); } return(set); }
public CardSet ExtractRandom(Random rand, int count) { CardSet set = new CardSet(); for (int i = 0; i < count; i++) { if (card_set.Count == 0) { break; } int card_index = rand.Next(card_set.Count); set.Add((Card)card_set[card_index]); RemoveCount(card_set[i]); card_set.RemoveAt(card_index); } return(set); }
public void Hit(Card card) { cards.Add(card); hit_count++; }
public CardSet ExtractTop(int count) { CardSet set = new CardSet(); for (int i = 0; i < count; i++) { if (card_set.Count == 0) break; set.Add(ExtractTop()); } return set; }
public CardSet ExtractRandom(Random rand, int count) { CardSet set = new CardSet(); for (int i = 0; i < count; i++) { if (card_set.Count == 0) break; int card_index = rand.Next(card_set.Count); set.Add((Card)card_set[card_index]); RemoveCount(card_set[i]); card_set.RemoveAt(card_index); } return set; }
public object Clone() { CardSet cloned_set = new CardSet(); foreach (Card card in this.card_set) cloned_set.Add((Card)(card.Clone())); return cloned_set; }