コード例 #1
0
        public void DrawCard(Player player = null, Dealer dealer = null)
        {
            if (dealer is null)
            {
                Console.WriteLine("{0} dealer hands you {1}", player.Name, DeckOfCards[0]);
                player.AddNumber(DeckOfCards[0].Number);
                DeckOfCards.Remove(DeckOfCards[0]);
            }

            else
            {
                Console.WriteLine("Dealer gets {0}", DeckOfCards[0]);
                dealer.AddNumber(DeckOfCards[0].Number);
                DeckOfCards.Remove(DeckOfCards[0]);
            }
        }