Пример #1
0
        public Card Defend(FoolHand fh, Card c, Card tc) //NEEDS TESTING
        {
            Card c1 = new Card();

            for (int i = 0; i < fh.NumCards; i++)
            {
                c1 = cards[i];
                if ((c1.HasMatchingSuit(c) && c1.Value > c.Value && c.Value != 1) ||
                    (c1.HasMatchingSuit(c) && c1.Value == 1 && c.Value != 1) ||
                    (c1.HasMatchingSuit(tc) && c.Suit != tc.Suit) ||
                    (c1.HasMatchingSuit(tc) && c.HasMatchingSuit(tc) && (c1.Value > c.Value)))
                {
                    cards.Remove(c1);
                    return(c1);
                }
            }
            return(null);
        }
Пример #2
0
 public Card DefendWithCard(Card c, FoolHand fh)
 {
     fh.cards.Remove(c);
     return(c);
 }
Пример #3
0
        public Card DefendWithSpecificCard(FoolHand fh, int index) //NEEDS TESTING
        {
            Card c = fh.cards[index];

            return(c);
        }