Exemplo n.º 1
0
        private async void Deal()
        {
            ComputerThoughts = "You dare challenge I? I can calculate more moves in a second than you can possibly imagine!";

            if (dealFinishied)
            {
                dealFinishied = false;
                var deck = Cards.Shuffle(Cards.FullDeck);

                foreach (var card in deck)
                {
                    RemainingDeck.Add(card);
                    await Task.Delay(1);
                }

                for (int i = 0; i < 10; i++)
                {
                    ComputerCards.Add(DrawTopCardFromDeck());
                    await Task.Delay(30);

                    HumanCards.Add(DrawTopCardFromDeck());
                    await Task.Delay(30);
                }

                Discards.Add(DrawTopCardFromDeck());
                dealFinishied = true;
            }
        }
Exemplo n.º 2
0
        private async void Deal()
        {
            var deck = Cards.Shuffle(Cards.FullDeck);

            foreach (var card in deck)
            {
                PossibleDeck.Add(card); // Possible list of card
                RemainingDeck.Add(card);
                await Task.Delay(1);
            }

            for (int i = 0; i < 10; i++)
            {
                Cards.Card computerCard = DrawTopCardFromDeck();
                ComputerCards.Add(computerCard);
                // Remove the list of card on computer hand, as it is seen
                removePossibleCard(computerCard);
                await Task.Delay(30);

                HumanCards.Add(DrawTopCardFromDeck());
                await Task.Delay(30);
            }

            Discards.Add(DrawTopCardFromDeck());
            // Remove the discard from possible deck
            removePossibleCard(Discards[Discards.Count - 1]);
            ScoreToWin = "Score To Win : " + winingScore.ToString();
            scoreLabel(firstWinnerScore, secondWinnerScore);
        }
Exemplo n.º 3
0
        private async void Deal()
        {
            var deck = Cards.Shuffle(Cards.FullDeck);

            foreach (var card in deck)
            {
                RemainingDeck.Add(card);
                await Task.Delay(1);
            }

            for (int i = 0; i < 10; i++)
            {
                ComputerCards.Add(DrawTopCardFromDeck());
                await Task.Delay(30);

                HumanCards.Add(DrawTopCardFromDeck());
                await Task.Delay(30);
            }

            Discards.Add(DrawTopCardFromDeck());
        }