コード例 #1
0
ファイル: Computer.cs プロジェクト: swjinx/Autoquartett
        /// <summary>
        /// chooses the card best suited to battle with the given choice
        /// </summary>
        /// <param name="choice">the choice</param>
        /// <returns>the chosen card</returns>
        private Card ChooseCard(int choice)
        {
            var cardPile = DrawingPile.ToList();
            var c        = brain.ChooseCardWithMaxValue(choice, cardPile);

            DrawingPile.Clear();
            cardPile.ForEach(x => DrawingPile.Enqueue(x));
            return(c);
        }
コード例 #2
0
ファイル: Human.cs プロジェクト: swjinx/Autoquartett
        /// <summary>
        /// Get's all the cards from the stack as a list and displays them on the console.
        /// </summary>
        /// <returns>List of all the cards from the stack</returns>
        private List <Card> GetAllCardsFromStack()
        {
            int         p          = Points;
            List <Card> stackCards = DrawingPile.ToList();

            DrawingPile.Clear();
            for (int i = 0; i < p; i++)
            {
                var tmpCard = stackCards[i];
                Console.WriteLine((i + 1) + ")");
                tmpCard.Show();
                Console.WriteLine();
            }
            return(stackCards);
        }