Пример #1
0
    private void OnOtherPlayerCards(ArrayList otherPlayerCard)
    {
        HupaiPlayerInfo hupInfo;
        Hashtable       OnterInfo;
        ArrayList       cardList;

        for (int i = 0; i < otherPlayerCard.Count; i++)
        {
            hupInfo            = new HupaiPlayerInfo();
            OnterInfo          = (Hashtable)otherPlayerCard[i];
            hupInfo.playerSeat = (Int64)OnterInfo["player"];
            cardList           = (ArrayList)OnterInfo["pai"];
            for (int j = 0; j < cardList.Count; j++)
            {
                hupInfo.cardList.Add((Int64)cardList[j]);
            }
            hupInfo.cardList.Sort();
            hupaiCompletePlayerHandcardSlist.Add(hupInfo);
        }

        if (_isLiuju)
        {
            _isLiuju      = false;
            selfGameState = SelfState.Not_playCard;
            _playersInfo.ReplacePlayerHandCardDataByHupai(hupaiCompletePlayerHandcardSlist);
            hupaiCompletePlayerHandcardSlist.Clear();
        }
    }
Пример #2
0
    private void OnHupai(ArrayList list, Int64 mopai, Int64 seat)
    {
        HupaiPlayerInfo hupInfo;

        hupInfo = new HupaiPlayerInfo();
        for (int j = 0; j < list.Count; j++)
        {
            hupInfo.cardList.Add((Int64)list[j]);
        }
        hupInfo.cardList.Sort();
        hupInfo.cardList.Remove(mopai);
        hupInfo.cardList.Add(mopai);
        // CardRules.SortCardsForInt(hupInfo.cardList, mopai);
        hupInfo.cardList.Reverse();
        hupInfo.playerSeat = seat;
        hupInfo.isHupai    = true;
        hupaiCompletePlayerHandcardSlist.Add(hupInfo);
        Reset();
    }
    public ReconnectionData(Hashtable data)
    {
        ArrayList       otherPlayerCard;
        ArrayList       cardList;;
        Hashtable       OnterInfo;
        HupaiPlayerInfo hupInfo;

        isHu = false;
        hupaiPlayerInfoList = new List <HupaiPlayerInfo>();
        if (data.ContainsKey("play_card_player"))
        {
            playCardPlayerSeat = (Int64)data["play_card_player"];
            processer_card     = (Int64)data["play_card"];
        }
        gangPaiInfo = data["gang_state"] as Hashtable;
        if (data.ContainsKey("is_hu"))
        {
            if ((bool)data["is_hu"])
            {
                isHu               = true;
                hupaiPlayerSeat    = (Int64)data["hu_player"];
                hupaiCardList      = (ArrayList)data["hu_card"];
                otherPlayerCard    = (ArrayList)data["other_card"];
                hupInfo            = new HupaiPlayerInfo();
                hupInfo.playerSeat = hupaiPlayerSeat;

                for (int j = 0; j < hupaiCardList.Count; j++)
                {
                    hupInfo.cardList.Add((Int64)hupaiCardList[j]);
                }
                hupaiPlayerInfoList.Add(hupInfo);
                for (int i = 0; i < otherPlayerCard.Count; i++)
                {
                    hupInfo            = new HupaiPlayerInfo();
                    OnterInfo          = (Hashtable)otherPlayerCard[i];
                    hupInfo.playerSeat = (Int64)OnterInfo["player"];
                    cardList           = (ArrayList)OnterInfo["pai"];
                    for (int j = 0; j < cardList.Count; j++)
                    {
                        hupInfo.cardList.Add((Int64)cardList[j]);
                    }
                    hupaiPlayerInfoList.Add(hupInfo);
                }
            }
        }

        bankerID  = (Int64)data["zhuang"];
        cardCount = (Int64)data["cards_count"];
        dice      = (Int64)data["r_saizi"];
        laizi     = (Int64)data["laizi"];
        score     = (Int64)data["score"];
        payState  = (Int64)data["payRule"];
        times     = (Int64)data["times"];
        if (data.ContainsKey("card_righter"))
        {
            cardRighter = (Int64)data["card_righter"];
        }

        //  processer = (Int64)data["processer"];
        play_count = (Int64)data["play_count"];
        peopleNum  = (Int64)data["peopleNum"];
        Hashtable playout  = data["player_play_cards"] as Hashtable;
        Hashtable pengcard = data["player_peng"] as Hashtable;
        Hashtable gangCard = data["player_gang"] as Hashtable;

        playerCardNum = (Hashtable)data["playerCardNum"];
        PlayerCardInfo info;
        string         index;

        playerCardinfoList = new List <PlayerCardInfo>();
        for (int i = 1; i < peopleNum + 1; i++)
        {
            index            = i.ToString();
            info             = new PlayerCardInfo();
            info.playOutArr  = playout[index] as ArrayList;
            info.pengArr     = pengcard[index] as ArrayList;
            info.GangArr     = gangCard[index] as ArrayList;
            info.handCardNum = (Int64)playerCardNum[index];
            playerCardinfoList.Add(info);
        }

        if (true)
        {
            isLiuJu = true;
        }
    }