示例#1
0
        /// <summary>
        /// 三张连续
        /// </summary>
        /// <param name="cards">需要排序后</param>
        /// <param name="groupObj"></param>
        /// <param name="cardSize"></param>
        /// <returns></returns>
        public bool IsThee(int[] cards, CardGroup groupObj, out int cardSize)
        {
            cardSize = 0;
            if (cards.Length % 3 != 0)
            {
                return false;
            }
            int val = GetCardSize(cards[0]), count = 0;

            for (var i = 0; i < cards.Length; i = i + 3)
            {
                int val1 = GetCardSize(cards[i]);
                if (val1 != val + count ||
                    groupObj.GetSameSizeCount(val1) != 3 ||
                    val1 >= (int)CardSize.C_2)
                {
                    return false;
                }
                count++;
            }
            cardSize = val;
            return true;
        }
示例#2
0
 /// <summary>
 /// 四张
 /// </summary>
 /// <param name="cards">需要排序后</param>
 /// <param name="groupObj"></param>
 /// <param name="cardSize"></param>
 /// <returns></returns>
 public bool IsFour(int[] cards, CardGroup groupObj, out int cardSize)
 {
     cardSize = 0;
     if (cards.Length != 4)
     {
         return false;
     }
     int val = GetCardSize(cards[0]);
     if (groupObj.GetSameSizeCount(val) == 4)
     {
         cardSize = val;
         return true;
     }
     return false;
 }