GR.Gambling.Blackjack.Shoe.Reset C# (CSharp) 메소드

Reset() 공개 메소드

public Reset ( ) : void
리턴 void
        public void Reset()
        {
            Clear();

            for (int deck = 0; deck < decks; deck++)
            {
                Add(CardsFactory.StandardDeck);
            }
        }

Usage Example

예제 #1
0
        public override void RoundOver(CardSet seen_cards, CardSet dealer_hand, CardSet[] player_hands, long game_id, int roll_after)
        {
            Hand dealer = new Hand(dealer_hand);

            Hand[] player = new Hand[player_hands.Length];
            for (int i = 0; i < player.Length; i++)
            {
                player[i]         = new Hand(player_hands[i]);
                player[i].Doubled = hand_doubled[i];
            }

            int actual_money   = roll_after - roll_before;
            int expected_money = ExpectedMoney(dealer, player);

            if (game_id > 0 && game_id == last_game_id)
            {
                throw new Exception("game_id == last_game_id");
            }

            if (action_count == 0)
            {
                bool dealer_natural = dealer.IsNatural();
                bool player_natural = player.Count() == 1 && player[0].IsNatural();

                if (!dealer_natural && !player_natural)
                {
                    throw new Exception("No actions made and no BJ");
                }
                else
                {
                    if (actual_money == 0)
                    {
                        if (dealer_natural && insurance_taken)
                        {
                            // this is correct
                        }
                        else if (!(dealer_natural && player_natural))
                        {
                            throw new Exception("BJ but no roll change (and no push)");
                        }
                    }
                }
            }

            game_logger.Showdown(dealer_hand, player_hands, game_id, expected_money, actual_money);
            Console.WriteLine("Roll: " + roll_after);

            last_game_id = game_id;

            if (expected_money != actual_money)
            {
                if (Config.Current.GetBooleanProperty("ThrowMoneyException"))
                {
                    throw new MoneyMismatchException(expected_money, actual_money);
                }
                else
                {
                    Console.WriteLine();
                    Console.WriteLine("EXPECTED MONEY MISMATCH!");
                    Console.WriteLine();
                }
            }

            shoe.Remove(seen_cards);

            if (shoe.FullCount - shoe.CardCount >= 84)
            {
                shoe.Reset();
            }

            Console.WriteLine("Seen cards: " + seen_cards);
            Console.WriteLine("Removed from shoe: {0} ({1})", shoe.FullCount - shoe.CardCount, seen_cards.Count);

            InitializeRound();
        }