コード例 #1
0
ファイル: JpTableData.cs プロジェクト: narakai/chessgame
 protected void OnGenZhuang(ISFSObject data)
 {
     if (data.ContainsKey("genZhuang"))
     {
         var gold      = data.GetIntArray("genZhuang");
         var chairGold = new int[gold.Length];
         for (int i = 0; i < gold.Length; i++)
         {
             var chair = UtilFunc.GetChairId(i);
             chairGold[chair] = gold[i];
         }
         EventDispatch.Dispatch((int)UIEventId.UserGlodChange, new EventData(chairGold));
     }
 }
コード例 #2
0
ファイル: JpTableData.cs プロジェクト: narakai/chessgame
        protected void OnBuZhang(ISFSObject data)
        {
            if (IsBuZhangFinish)
            {
                IsBuZhangFinish = false;
                BuZhang.Clear();
            }

            var seat        = data.GetInt(RequestKey.KeySeat);
            var buZhangCard = data.GetIntArray("buZhangCard");
            var cards       = data.GetIntArray(RequestKey.KeyCards);
            var buData      = new BuZhangData {
                Chair = UtilFunc.GetChairId(seat), Cards = cards, BuZhangCards = buZhangCard
            };

            BuZhang.Add(buData);
            foreach (var bCard in buZhangCard)
            {
                BuZhangList[seat].Add(bCard);
            }
        }
コード例 #3
0
ファイル: GameUI.cs プロジェクト: narakai/chessgame
        protected virtual void OnHu(EventData evn)
        {
            GameResult data = (GameResult)evn.data1;
            //显示吃碰杠特效
            EnCpgEffect effect = EnCpgEffect.none;

            if (data.HuType == MjRequestData.MJRequestTypeHu)
            {
                effect = EnCpgEffect.hu;
            }
            else if (data.HuType == MjRequestData.MJReqTypeZiMo)
            {
                effect = EnCpgEffect.zimo;
            }

            //游金胡特效
            switch (data.QzmjHuType)
            {
            case QzmjHuType.youjin: effect = EnCpgEffect.youjin; break;

            case QzmjHuType.shuangyou: effect = EnCpgEffect.shuangyou; break;

            case QzmjHuType.sanyou: effect = EnCpgEffect.sanyou; break;

            case QzmjHuType.sanjindao: effect = EnCpgEffect.sanjindao; break;
            }

            foreach (int i in data.HuSeat)
            {
                var chair = UtilFunc.GetChairId(i);
                PlayersPnl.PlayEffect(chair, effect);
            }

            GetOpreateMenu().Reset();
            if (TrusteeshipHelper.Instance != null)
            {
                //取消托管
                TrusteeshipHelper.Instance.OnDisableTrusteeshipClick();
            }
        }
コード例 #4
0
ファイル: GameUI.cs プロジェクト: narakai/chessgame
        public void ShowThrowEffectOnYoujin(int eventId, EventData evn)
        {
            if ((UIEventId)eventId == UIEventId.ShowThrowEffectOnYoujin)
            {
                int seat = (int)evn.data1;
                int type = (int)evn.data2;

                //显示吃碰杠特效
                EnCpgEffect effect = EnCpgEffect.none;

                //游金胡特效
                switch (type)
                {
                case 2: effect = EnCpgEffect.shuangyou; break;

                case 3: effect = EnCpgEffect.sanyou; break;
                }

                var chair = UtilFunc.GetChairId(seat);
                PlayersPnl.PlayEffect(chair, effect);
            }
        }