Exemplo n.º 1
0
    public void  onLQShowPlay(object data)
    {
        //这里要判断是否是自己在下棋,如果不是则仅仅刷新
        GameEvent.sC2V_PlayOrMove pm = (GameEvent.sC2V_PlayOrMove)data;

        //调用下棋接口
        Hex pos = CommonUtil.Util.Point2Hex(new Vector3i(pm.x, pm.y, 0));

        if (pm.local == (int)CommonDefine.SEAT.SELF)
        {
            Hex coord;
            int dir;
            int campId;

            if (!_Port.ConfirmOperatingChess(out coord, out dir, out campId))
            {
                CommonUtil.Util.showDialog("温馨提示", "操作出错了。。。");

                //原则上不应该出现
                if (!_Port.IsEmptyAt(pos))
                {
                    //删除已有棋子
                    _Port.DisappearAt(pos);
                }

                _Port.TryPlaceChessAt(getPlayerIDByLocal(pm.local), (int)pm.direction, pos);
            }

            //此时关闭
            //_Port.DisableAllChessOperation();
        }
        else
        {
            //原则上不应该出现
            if (!_Port.IsEmptyAt(pos))
            {
                //删除已有棋子
                _Port.DisappearAt(pos);
            }

            _Port.TryPlaceChessAt(getPlayerIDByLocal(pm.local), (int)pm.direction, pos);
        }

        //更新各个玩家的棋子数
        updatePlayerChessNum();
    }
Exemplo n.º 2
0
    public void onShowPlay(object data)
    {
        GameEvent.sC2V_PlayOrMove pm = (GameEvent.sC2V_PlayOrMove)data;

        if (pm.local == (int)CommonDefine.SEAT.SELF)
        {
            _btnPass.interactable = true;
        }

        //落子之棋盘不能操作,无论是否是自己
        for (int i = 0; i < 6; i++)
        {
            banDir(true, i);
        }

        setPassBtnTxt("Pass");

        setCurrentStep(eActionStep.STEP_PASS);
    }