Пример #1
0
    void InitGame(RX_SeatInfo sender)
    {
        gameState   = RX_GAME_STATE.QIANGDIZHU;
        currentSeat = sender;
        passCount   = 0;

        //set labels
        SetRoll(currentSeat, RX_ROLE_TYPE.RX_ROLE_NORMAL);
        SetRoll(left_seat, RX_ROLE_TYPE.RX_ROLE_NORMAL);
        SetRoll(right_seat, RX_ROLE_TYPE.RX_ROLE_NORMAL);

        currentSeat.SetLabel(1, "������?");
        giveAHandButtonLabel.text = "������";
    }
Пример #2
0
    public void PopSet(int actor)
    {
        if (currentSeat == bottom_seat || actor == 1)
        {
            if (gameState == RX_GAME_STATE.QIANGDIZHU)
            {
                SetRoll(currentSeat, RX_ROLE_TYPE.RX_ROLE_DIZHU);
                giveAHandButtonLabel.text = "����";
                gameState = RX_GAME_STATE.PLAYING;
                if (currentSeat == bottom_seat)
                {
                    GetComponent <NetworkView>().RPC("PopSet", RPCMode.Others, 1);
                }
                return;
            }

            currentCardSet = currentSeat.PopCardSet();
            if (currentCardSet == null)
            {
                currentSeat.ClearPopCard();
                labelMsg.text = "Failed!";
            }
            else
            {
                //tongBu other's pop cards    RX_CardSet
                if (currentSeat == bottom_seat)
                {
                    string sendData = "";
                    for (int i = 0; i < currentCardSet.Card_lister.Count; i++)
                    {
                        sendData += currentCardSet.Card_lister[i].ToString() + "|";
                    }
                    GetComponent <NetworkView>().RPC("TongBuPopSet", RPCMode.Others, sendData);
                }

                currentSeat.ClearPopCard();
                passCount = 0;

                if (currentSeat.Card_list.Count == 0)
                {
                    labelMsg.text = currentSeat.Seat_label.text.Split('-')[0] + "��ʤ!";
                    return;
                }
                currentSeat.SetLabel(1, "�ȴ�����");

                //set currentSet to next
                SkipHand();

                labelMsg.text  = "Play Success!\n";
                labelMsg.text += (currentCardSet.Card_type + "\n" + currentCardSet.Card_level.ToString() + "\n");
                labelMsg.text += "-->" + currentSeat.Seat_pos.ToString() + "<-- turn!\n";
                prevCardSet    = currentCardSet;
                currentCardSet = null;
                return;
            }
        }
        else
        {
            labelMsg.text += "Not your turn!";
        }
    }