Exemple #1
0
        private static void Main()
        {
            if (!StartGame()) return;

            string playerName = GetPlayerName();
            Deckpile shoe = new Deckpile();

            for (int i = 0; i < 4; i++)
            {
                Deck deck = new Deck();
                deck.AddToStack(shoe);
                shoe.Shuffle();
            }

            BlackjackDealer dealer = new ConsoleDealer("DEALER", shoe, Console.Instance);
            PlayerBase player = new ConsolePlayer(playerName, Console.Instance, new Bank(1000));

            dealer.Hand.HandChanged += (sender, changedArgs) => Console.Instance.Print(changedArgs.Player.ToString());
            player.Hand.HandChanged += (sender, changedArgs) => Console.Instance.Print(changedArgs.Player.ToString());

            dealer.AddPlayer(player);

            do
            {
                dealer.NewGame();
            } while (PlayAgain());
        }
Exemple #2
0
        public static ICardShoe CreateFourDeckShoe()
        {
            Deckpile shoe = new Deckpile();
            for (int i = 0; i < 4; i++)
            {
                Deck deck = new Deck();
                deck.AddToStack(shoe);
                shoe.Shuffle();
            }

            return shoe;
        }