Esempio n. 1
0
    public void ChoiseRoomState(MJInstructionsProto data)
    {
        switch (data.optList[0].ins)
        {
        case eMJInstructionsType.CHANGETHREE:     //换3张
            MJGameModel.Inst.mStartGameData.roomInfo.roomState = eRoomState.CHANGETHREE;
            SQDebug.Log("房间状态为:====>>>换3张");
            mGameUI.DelayRun(1f, () => { mGameUI.ChangeThreeUI(data); });
            mGameUI.SetLeftTime(MJGameModel.Inst.TurnFixedTime, true);

            break;

        case eMJInstructionsType.FIXEDCOLOR:    //定缺
            if (MJGameModel.Inst.mStartGameData.roomInfo.roomState == eRoomState.START)
            {
                break;
            }
            MJGameModel.Inst.mStartGameData.roomInfo.roomState = eRoomState.FIXEDCOLOR;
            SQDebug.Log("房间状态为:====>>>定缺");
            mGameUI.DelayRun(0.1f, () => { mGameUI.ChangeFixeDcolorUI(data); });
            mGameUI.SetLeftTime(MJGameModel.Inst.TurnFixedTime, true);
            break;

        default:                                                                                                                          //
            MJGameModel.Inst.mStartGameData.roomInfo.roomState = eRoomState.START;                                                        //改变房间状态
            SQDebug.Log("房间状态为:====>>>游戏中");
            bool isHasDataBefore         = (MJGameModel.Inst.hasCanHuListCards != null && MJGameModel.Inst.hasCanHuListCards.Count != 0); //处理数据之前是否有数据
            List <OptItemStruct> optList = MergeInsData(data.optList);
            bool isHasDataBehind         = (MJGameModel.Inst.hasCanHuListCards != null && MJGameModel.Inst.hasCanHuListCards.Count != 0); //处理数据之后是否有数据
            mGameUI.ServerShowInstructions(optList, isHasDataBefore != isHasDataBehind);
            break;
        }
    }
Esempio n. 2
0
 /// <summary>
 /// 定缺处理
 /// </summary>
 public void ChangeFixeDcolorUI(MJInstructionsProto data)
 {
     foreach (var item in MJGameModel.Inst.mRoomPlayers)
     {
         if (item != null)
         {
             if (item.seatId == MJGameModel.Inst.mMySeatId)
             {
                 mMJFixeDcolor.IntoView(data.optList[0].type);
             }
             else
             {
                 mAllPlayer[MJGameModel.Inst.mnewSeatToIndex[item.seatId]].SetDingqueShow(true, "定缺中");
             }
         }
     }
 }
Esempio n. 3
0
    /// <summary>
    /// 同步玩家可以操作什么指令
    /// </summary>
    /// <param name="msg"></param>
    private void GetOnOptListACK(MessageData msg)
    {
        MJInstructionsProto data = msg.Read <MJInstructionsProto>();

        SQDebug.Log("我收到同步操作啦" + Time.deltaTime);
        //mGameUI.GetInstructionsACK(data);
        MJGameModel.Inst.mSycOptListResponse = data;
        if (!MJGameModel.Inst.isFirstGetStartGameData)
        {
            //当前状态为换三张且没有缓存操作,且该操作不是换三张
            if (MJGameModel.Inst.mStartGameData.roomInfo.roomState == eRoomState.CHANGETHREE && MJGameModel.Inst.OptCachInChange == null && data.optList[0].ins != eMJInstructionsType.CHANGETHREE)
            {
                MJGameModel.Inst.OptCachInChange = msg;
                return;
            }
            ChoiseRoomState(data);
        }
    }
Esempio n. 4
0
 /// <summary>
 /// 换3张状态
 /// </summary>
 public void ChangeThreeUI(MJInstructionsProto data)
 {
     for (int i = 0; i < MJGameModel.Inst.mRoomPlayers.Length; i++)
     {
         PlayerInfoStruct item = MJGameModel.Inst.mRoomPlayers[i];
         if (item != null)
         {
             if (item.seatId == MJGameModel.Inst.mMySeatId)
             {
                 mMJChangeThree.IntoThreeWidget(true);
             }
             else
             {
                 mAllPlayer[MJGameModel.Inst.mnewSeatToIndex[item.seatId]].SetChangeStateShow(true);
             }
         }
     }
     InitChaneThreeHandCards(mAllPlayer[MJGameModel.Inst.mnewSeatToIndex[MJGameModel.Inst.mMySeatId]], data.optList[0].cards);
 }