예제 #1
0
        public CompHand CompPickCard(CompHand ch, Card c, Card tc)
        {
            if (ch.CompDefend(ch, c, tc) == null)
            {
                ch.cards.Add(c);
            }

            return(ch);
        }
예제 #2
0
        //public bool CanAttackAgain(CompHand ch, PlayHand ph) //Checks if Computer can attack again based on cards in the PlayHand
        //{
        //    bool canAttack = false;

        //    for (int i = 0; i < ph.NumCards; i++)
        //    {
        //        Card c = ph.GetCard(i);
        //        for (int j = 0; j < ch.NumCards; j++)
        //        {
        //            if (ch.cards[j].Value == c.Value)
        //                canAttack = true;
        //        }
        //    }
        //    return canAttack;
        //}

        public bool CanDefend(CompHand ch, Card c, Card tc) //determines if a player is able to defend
        {
            bool canDefend = false;

            if (ch.CompDefend(ch, c, tc) != null)
            {
                canDefend = true;
            }

            return(canDefend);
        }