예제 #1
0
        // Starts turn
        public async override void StartTurn()
        {
            // Calls the base function
            base.StartTurn();

            // Wait 1 second without disturbing UI functionality such as clicking, etc
            await Sleep.sleep(1000);

            // Keep hitting until the next card will cause a bust
            while (deck.Peek() + sum < 22)
            {
                await Sleep.sleep(500); // Wait half a second

                Hit(true);              // Hit facedown
            }

            // Generate a new random number
            int randint = rndGen.Next(1, 100);

            // Wait half a second
            await Sleep.sleep(500);

            // Decide if the player will bust or not
            if (randint > difficulty)
            {
                Hit(true); // Hit facedown
            }

            // Wait half a second
            await Sleep.sleep(500);

            // End turn
            EndTurn();
        }
예제 #2
0
        /* Override Functions */

        public async override void StartTurn()
        {
            EnableControls(true);

            await Sleep.sleep(1000);

            while (sum < 16)
            {
                await Sleep.sleep(500);

                Hit(true);
            }

            EndTurn();
        }