Ejemplo n.º 1
0
    public void play(Table.Play play)
    {
        Debug.Log("收到play返回");
        if (play.err_no == 0)
        {
            switch (play.id.idToPos())
            {
            case 0:
                GameConst.isTurn = false;
                CardController.Instance.cleanUp();
                for (int i = 0; i < play.leftcard.Count; i++)
                {
                    CardController.Instance.addCard(CardConst.getCardInfo(play.leftcard[i]).type, CardConst.getCardInfo(play.leftcard[i]).value);
                }
                DataMgr.Instance._heCards[0] = play.outcards;
                break;

            case 1:
                DataMgr.Instance.rightCardNum = play.leftcard.Count;
                DataMgr.Instance._heCards[1]  = play.outcards;
                break;

            case 2:
                DataMgr.Instance.topCardNum  = play.leftcard.Count;
                DataMgr.Instance._heCards[2] = play.outcards;
                break;

            case 3:
                DataMgr.Instance.leftCardNum = play.leftcard.Count;
                DataMgr.Instance._heCards[3] = play.outcards;
                break;
            }

            SoundMgr._instance.soundPlay(GameConst.Language + ((RoleController.Instance._playerDic[play.id].Sex?0:1000) + play.card), GameConst.soundVol);
            DataMgr.Instance._curCard = play.card;
            Debug.Log("现在的cur" + play.card);
            EventDispatcher.Instance.Dispatch(GameEventConst.PUT_HE_CARD, play.id.idToPos(), play.card);
        }
        else
        {
            //QuickTips.ShowRedQuickTips("play___" + play.err_no);
        }
    }
Ejemplo n.º 2
0
 public static void Play(int num)
 {
     Table.Play play = new Table.Play();
     play.card = num;
     NetClient.Instance().WriteMsg("Table.Play", play);
 }