コード例 #1
0
ファイル: Program.cs プロジェクト: GrimeyCoder/blackjack_cs
        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());
        }
コード例 #2
0
ファイル: Shoe.cs プロジェクト: GrimeyCoder/blackjack_cs
        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;
        }