Exemplo n.º 1
0
    public void  onLQShowTurn(object data)
    {
        GameEvent.sC2V_ShowTurn st = (GameEvent.sC2V_ShowTurn)data;

        // 如果是别人pass导致的turn变化,则切换手,否则是第一次发turn,不需要切换
        if (st.isPassTurn)
        {
            _Port.ChooseOperatingCamp((_Port.GetOperatingCampId() + 1) % _PlayerNum);
        }


        //超时的换手,则清除试棋的棋子
        if (st.isTimeOut)
        {
            //如果存在试棋的棋子则删除
            Hex coord;
            int dir;
            int campId;
            if (_Port.GetOperatingChessInfo(out coord, out dir, out campId))
            {
                _Port.CancelOperatingChess(out coord, out dir, out campId);
            }
        }
    }
Exemplo n.º 2
0
 public void onShowTurn(object data)
 {
     GameEvent.sC2V_ShowTurn st = (GameEvent.sC2V_ShowTurn)data;
     showTurn(false, st);
 }
Exemplo n.º 3
0
    public void showTurn(bool isPass, GameEvent.sC2V_ShowTurn st)
    {
        if (!isPass)
        {
            if ((int)st.local == (int)CommonDefine.SEAT.SELF)
            {
                setCurrentStep(eActionStep.STEP_PLAY);
            }
            else
            {
                setCurrentStep(eActionStep.STEP_NOT_TURN);
            }
        }

        //设置按钮图为对应的出手方
        _btnPass.image.sprite = CommonUtil.Util.getSpriteByLocal(st.local, CommonDefine.ResPath.LQ_PASS_BTN);
        if ((int)st.local == (int)CommonDefine.SEAT.SELF)
        {
            _btnPass.interactable = true;

            for (int i = 0; i < 6; i++)
            {
                banDir(false, i);
            }
        }
        else
        {
            _btnPass.interactable = false;
        }

        setPassBtnTxt("Play");

        if (!isPass)
        {
            //ON TURN
            //设置禁用方向
            for (int i = 0; i < st.banDirList.Count; i++)
            {
                if (st.banDirList [i] != -1)
                {
                    banDir(true, st.banDirList [i]);
                }
            }
        }

        if (st.isPassTurn)
        {
            updateRound(st.round);
        }

        if (_lmtTurnTime != 0)
        {
            if (IsInvoking("updateClock"))
            {
                CancelInvoke();
            }
            _leftTime = _lmtTurnTime;            // 重置限手时间

            InvokeRepeating("updateClock", 0.0f, 1.0f);
        }
    }