Ejemplo n.º 1
0
        //---------------------------------------------------------------------------------------------

        //在更具数据显示房间所有信息前 初始房间显示(清理房间)
        public void InitAll(NiuNiu.Room.RoomModel roomModel, Room.SuperModel superModel)
        {
            InitCountdownUI();
            _SelectScore.gameObject.SetActive(false);

            //_StartBtn.GetComponent<Button>().interactable = false;
            _BankerBtnParent.gameObject.SetActive(false);
            _NoBankerBtnParent.gameObject.SetActive(false);
            //_OpenPokerBtn.GetComponent<Button>().interactable = false;
            _OpenPokerBtn.gameObject.SetActive(false);

            _Hint.rectTransform.parent.gameObject.SetActive(false);

            //_GameOverPanel.gameObject.SetActive(false);
            _ViewShareClickBtn.gameObject.SetActive(false);
            InitRoomModel(roomModel);

            _ReadyBtn.gameObject.SetActive(false);

            if (superModel == Room.SuperModel.PassionRoom)
            {
                for (int i = 0; i < _BtnSelectScores.Length; i++)
                {
#if IS_WANGQUE
                    _BtnSelectScores[i].gameObject.SetActive(string.Equals(_BtnSelectScores[i].gameObject.name, "1") || string.Equals(_BtnSelectScores[i].gameObject.name, "2") || string.Equals(_BtnSelectScores[i].gameObject.name, "3"));
#elif IS_CANGZHOU
                    _BtnSelectScores[i].gameObject.SetActive(string.Equals(_BtnSelectScores[i].gameObject.name, "5") || string.Equals(_BtnSelectScores[i].gameObject.name, "8") || string.Equals(_BtnSelectScores[i].gameObject.name, "10"));
#endif
                }
            }
        }
Ejemplo n.º 2
0
        //----------------新版计算---------------------------------------------------------------------------------------------------
        #region 高级场算法
        public List <NiuNiu.Poker> Calculate(List <NiuNiu.Poker> pokerList, out bool whetherNiu, out int type, Room.SuperModel superModel = Room.SuperModel.PassionRoom)
        {
            whetherNiu = false;
            type       = 0;


            //一 排序
            NiuNiuSort.Instance.SortList(pokerList);

            //if (superModel == Room.SuperModel.CommonRoom)
            //{
            //    if (pokerList.Count >= 4)
            //    {
            //        //炸弹
            //        if (pokerList[0].size == pokerList[3].size)
            //        {
            //            type = 13;
            //            return pokerList;
            //        }

            //    }

            //    //牛
            //    if (!whetherNiu)
            //    {
            //        CalculateNiu(pokerList, out whetherNiu);
            //        if (whetherNiu) type = 1;
            //    }

            //}

            if (pokerList.Count == 3)
            {
                //牛
                if (!whetherNiu)
                {
                    CalculateNiu(pokerList, out whetherNiu);
                    if (whetherNiu)
                    {
                        type = 1;
                    }
                }
            }
            else if (pokerList.Count == 4)
            {
                //炸弹
                if (pokerList[0].size == pokerList[3].size)
                {
                    type = 13;
                    return(pokerList);
                }

                //牛
                if (!whetherNiu)
                {
                    CalculateNiu(pokerList, out whetherNiu);
                    if (whetherNiu)
                    {
                        type = 1;
                    }
                }
            }
            else if (pokerList.Count == 5)
            {
                bool tonghua = true; //计算同花
                bool shunza  = true; //计算顺子

                for (int i = 0; i < pokerList.Count - 1; i++)
                {
                    if (pokerList[i].color != pokerList[i + 1].color)
                    {
                        tonghua = false;
                    }
                    if (pokerList[i].size != (pokerList[i + 1].size - 1))
                    {
                        if (pokerList[i].size == 1 && pokerList[i].size == 10)
                        {
                            continue;
                        }
                        shunza = false;
                    }
                }
                for (int i = 0; i < pokerList.Count; i++)
                {
                    if (pokerList[i].size > 13)
                    {
                        tonghua = false;
                        shunza  = false;
                    }
                }


                //同花顺
                if (tonghua && shunza)
                {
                    type = 17;
                    return(pokerList);
                }

                //炸弹
                if (pokerList[0].size == pokerList[3].size)
                {
                    type = 13;
                    return(pokerList);
                }

                //葫芦
                if (((pokerList[0].size == pokerList[2].size) && pokerList[3].size == pokerList[4].size) || ((pokerList[0].size == pokerList[1].size) && pokerList[2].size == pokerList[4].size))
                {
                    type = 16;
                    return(pokerList);
                }

                if (tonghua)
                {
                    type = 15;
                    return(pokerList);
                }

                if (shunza)
                {
                    type = 14;
                    return(pokerList);
                }
                //牛
                if (!whetherNiu)
                {
                    CalculateNiu(pokerList, out whetherNiu);
                    if (whetherNiu)
                    {
                        type = 1;
                    }
                }
            }


            //炸弹 = 13,
            //顺子 = 14,
            //同花 = 15,
            //葫芦 = 16,
            //同花顺 = 17,


            return(pokerList);
        }