コード例 #1
0
        /// <summary>
        /// Finds the location of the first matching card in the deck.
        /// </summary>
        /// <param name="suit">Suit to match.</param>
        /// <param name="number">Value to match.</param>
        /// <returns></returns>
        public int Findcard(Card.Suits suit, Card.Numbers number)
        {
            int card = 0;

            for (int i = 0; i < _deck.Count; i++)
            {
                if (_deck[i].Suit == suit && _deck[i].Number == number)
                {
                    card = i;
                    break;
                }
            }
            return(card);
        }
コード例 #2
0
 /// <summary>
 /// Removes the first matching card from the deck.
 /// </summary>
 /// <param name="suit">Suit to match.</param>
 /// <param name="number">Value to match.</param>
 /// <returns></returns>
 public Card Takecard(Card.Suits suit, Card.Numbers number)
 {
     return(Takecard(Findcard(suit, number)));
 }