Example #1
0
    //玩家明杠操作
    public void addMingGang(int pos, int mj)
    {
        string        sendPos = "";
        List <Action> alist   = null;

        if (positon == pos)
        {
            alist   = myAcionList;
            sendPos = "bot";
        }
        else
        {
            switch (TryGetLocPos(positon, pos))
            {
            case "right":
                alist   = rightAcionList;
                sendPos = "right";
                break;

            case "top":
                alist   = topAcionList;
                sendPos = "top";
                break;

            case "left":
                alist   = leftAcionList;
                sendPos = "left";
                break;
            }
        }

        //找到明杠的碰牌,修改为明杠类型
        for (int i = 0; i < alist.Count; i++)
        {
            if (alist[i].getActionType() == CardView.CHI_PENG_碰牌)
            {
                int pengMj = alist[i].getValue();
                if (pengMj == mj)
                {
                    alist[i].setActionType(CardView.CHI_MINGGANG_明杠);
                    alist[i].getActionData().Add(mj);
                    break;
                }
            }
        }
        //
        RoomEvent.DoMingGang(sendPos, mj);
    }