示例#1
0
        /// <summary>
        /// 翻牌
        /// </summary>
        /// <returns></returns>
        protected override void NewFanPai()
        {
            var gdata = App.GetGameData <NnGameData>();

            IsOpenCard = true;
            Two.Clear();
            _pokersPos = new List <int> {
                0, 1, 2, 3, 4
            };
            var count = Porkers.Count;

            switch (App.GameKey)
            {
            case "nn41":
            case "nntp":
                if (gdata.NewCard == 0)
                {
                    Porkers[count - 1].GetComponent <UISprite>().spriteName = "0x" + Cards[count - 1].ToString("X");
                }
                else
                {
                    Porkers[count - 1].GetComponent <UISprite>().spriteName = "0x" + gdata.NewCard.ToString("X");
                }
                break;

            default:
                for (int i = 0; i < count; i++)
                {
                    Porkers[i].SetActive(true);
                    Porkers[i].GetComponent <UISprite>().spriteName = "0x" + Cards[i].ToString("X");
                }
                break;
            }
            var cVal = CalculateCards();

            if (cVal != null && !_isComplete)
            {
                for (var i = 0; i < cVal.Length; i++)
                {
                    for (var j = 0; j < Porkers.Count; j++)
                    {
                        if (Porkers[j].GetComponent <UISprite>().spriteName != "0x" + cVal[i].ToString("X"))
                        {
                            continue;
                        }
                        Two.Add(j);
                    }
                }
                foreach (var t in Two)
                {
                    _pokersPos.Remove(t);
                }
            }

            if (!gdata.IsEndCardFlop)
            {
                OnOpenCardBtn();
            }
        }
示例#2
0
 /// <summary>
 /// 点击亮牌按钮
 /// </summary>
 public void OnOpenCardBtn()
 {
     ShowLiangPai(false);
     ShowCard();
     NiuNumShow();
     App.GetRServer <NnGameServer>().SendLiang();
     Two.Clear();
 }