コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: Loki2099/c_lessons
        private void DealHands()
        {
            PlayerHand.Add(DealCard());
            DisplayCard(playersCards, PlayerHand.Last());

            DealerHand.Add(DealCard());
            DisplayCard(dealersCards, DealerHand.Last());


            PlayerHand.Add(DealCard());
            DisplayCard(playersCards, PlayerHand.Last());

            DealerHand.Add(DealCard());
            Dispatcher.Invoke(() => dealersCards.Children.Add(new TextEdit()
            {
                Name = "FaceDown"
            }));
            DealCheck();

            if (!gameOver)
            {
                Dispatcher.Invoke(() => { btnHit.IsEnabled = true; btnStand.IsEnabled = true; });
            }
        }