Пример #1
0
        /// <summary>
        /// converts card ID to actual card value
        /// </summary>
        /// <param name="card">card to convert</param>
        /// <returns>card value</returns>
        public int ConvertFaceValue(Card card)
        {
            int cardValue = 0;

            switch (card.FaceValue)
            {
                case Enums.FaceValue.ten:
                case Enums.FaceValue.jack:
                case Enums.FaceValue.queen:
                case Enums.FaceValue.king:
                    cardValue = 10;
                    break;
                case Enums.FaceValue.ace:
                    cardValue = 1;
                    break;
                default:
                    cardValue = (int)card.FaceValue;
                    break;
            }
            return cardValue;
        }
Пример #2
0
 /// <summary>
 /// add card to hand
 /// </summary>
 /// <param name="card">card to add</param>
 public void AddCard(Card card)
 {
     _cards.Add(card);
 }