public void ReSetCheckSpecCardTypesDefault() { checkSpeckCardSet.Clear(); for (SpecCardsType i = SpecCardsType.Normal + 1; i < SpecCardsType.Count; i++) { checkSpeckCardSet.Add(i); } }
/// <summary> /// 设置只检查这些特殊牌型: 6炸、7炸、8炸、至尊雷、一条龙、至尊一条龙 /// </summary> public void PreSetCheckSpecCardTypes1() { SpecCardsType[] specCardsTypes = new SpecCardsType[] { SpecCardsType.SixBomb, SpecCardsType.SevenBomb, SpecCardsType.EightBomb, SpecCardsType.ZhiZunLei76, SpecCardsType.ZhiZunLei66, SpecCardsType.YiTiaoLong, SpecCardsType.ZhiZunQinLong }; SetCheckSpecCardTypes(specCardsTypes); }
static void Main(string[] args) { CardFace[] cardValues = new CardFace[] { CardFace.Heart_2, CardFace.Heart_2, CardFace.Heart_5, CardFace.Heart_10, CardFace.Heart_10, }; CardsTypeDict dict = CardsTypeDict.Instance; ///////////////////////////////////////////////// //2.获取普通牌型组合 CardsTypeCreater creater = new CardsTypeCreater(); creater.CreateAllCardsTypeArray(cardValues); //获取cardValues牌中的三条牌型表 List <CardsTypeInfo> santiaos = creater.SantiaoList; List <CardsTypeInfo> tonghuaShun = creater.TonghuashunList; List <CardFace> cardFaceList = new List <CardFace>(); int idx = 3; //for (int i = 0; i < santiaos[idx].cardFaceValues.Length; i++) // cardFaceList.Add(santiaos[idx].cardFaceValues[i]); //for (int i = 0; i < santiaos[idx].laiziCount; i++) // cardFaceList.Add(CardFace.RedJoker); //CardsTypeMatch match = new CardsTypeMatch(); //MatchCardFacesInfo info = match.ComputeMatchCardFacesInfo(cardFaceList.ToArray()); ///////////////////////////////////////////////// //3.特殊牌型检查 SpecCardsCheck specCard = new SpecCardsCheck(); //存储特殊牌型结果(已排好序) CardFace[] outCards = new CardFace[13]; CardFace[] outComputedCards = new CardFace[13]; SpecCardsType type = specCard.Check(cardValues, outCards, outComputedCards); ///////////////////////////////////////////////// //4.测试牌型估值 List <SlotCardsEvalInfo> evalInfoList; CardsTypeEvaluation eval = new CardsTypeEvaluation(); //eval.SetOptimalSlotCardsEvalInfoCount(10); string text = "开始计时"; Console.WriteLine(text); System.Diagnostics.Stopwatch stopwatch = new System.Diagnostics.Stopwatch(); stopwatch.Start(); // evalInfoList = eval.Evaluation(cardValues); stopwatch.Stop(); // long ms = stopwatch.ElapsedMilliseconds; text = "用时:" + ms + "毫秒"; Console.WriteLine(text); Console.ReadLine(); }
SpecCardsType IsSpecCards(CardInfo[] cards, int laiziCount, CardFace[] outFaceValues, CardFace[] outComputedFaceValues) { SpecCardsType type = SpecCardsType.Normal; if (checkSpeckCardSet.Contains(SpecCardsType.ZhiZunQinLong) && IsZhiZunQinLong(cards, laiziCount, outFaceValues, outComputedFaceValues)) { type = SpecCardsType.ZhiZunQinLong; } else if (checkSpeckCardSet.Contains(SpecCardsType.YiTiaoLong) && IsYiTiaoLong(cards, laiziCount, outFaceValues, outComputedFaceValues)) { type = SpecCardsType.YiTiaoLong; } else if (checkSpeckCardSet.Contains(SpecCardsType.ZhiZunLei76) && IsZhiZunLei(cards, laiziCount, outFaceValues, outComputedFaceValues) == 1) { type = SpecCardsType.ZhiZunLei76; } else if (checkSpeckCardSet.Contains(SpecCardsType.ZhiZunLei66) && IsZhiZunLei(cards, laiziCount, outFaceValues, outComputedFaceValues) == 2) { type = SpecCardsType.ZhiZunLei66; } else if (checkSpeckCardSet.Contains(SpecCardsType.EightBomb) && IsEightBomb(cards, laiziCount, outFaceValues, outComputedFaceValues)) { type = SpecCardsType.EightBomb; } else if (checkSpeckCardSet.Contains(SpecCardsType.SevenBomb) && IsSevenBomb(cards, laiziCount, outFaceValues, outComputedFaceValues)) { type = SpecCardsType.SevenBomb; } else if (checkSpeckCardSet.Contains(SpecCardsType.SixBomb) && IsSixBomb(cards, laiziCount, outFaceValues, outComputedFaceValues)) { type = SpecCardsType.SixBomb; } else if (checkSpeckCardSet.Contains(SpecCardsType.SanShunZi) && IsSanShunZi(cards, laiziCount, outFaceValues, outComputedFaceValues)) { type = SpecCardsType.SanShunZi; } else if (checkSpeckCardSet.Contains(SpecCardsType.SanTongHua) && IsSanTongHua(cards, laiziCount, outFaceValues, outComputedFaceValues)) { type = SpecCardsType.SanTongHua; } else if (checkSpeckCardSet.Contains(SpecCardsType.SiTaoSan) && IsSiTaoSan(cards, laiziCount, outFaceValues, outComputedFaceValues)) { type = SpecCardsType.SiTaoSan; } else if (checkSpeckCardSet.Contains(SpecCardsType.LiuDuiBan) && IsLiuDuiBan(cards, laiziCount, outFaceValues, outComputedFaceValues)) { type = SpecCardsType.LiuDuiBan; } return(type); }