Exemplo n.º 1
0
    /// <summary>
    /// 出牌
    /// </summary>
    /// <param name="proto"></param>
    public PokersType PlayPoker(PDK_OPERATE proto)
    {
        SeatEntity seat = GetSeatBySeatPos(proto.pos);

        if (seat == null)
        {
            return(PokersType.None);
        }
        CurrentRoom.OperateSeat        = null;
        CurrentRoom.CurrAlreadyPlayPos = proto.pos;
        //CurrentRoom.RecentlyPlayPoker.Reset();
        //CurrentRoom.CurrPlayPoker.Clear();
        seat.Status = SeatEntity.SeatStatus.Wait;

        List <Poker>      playPoker    = new List <Poker>();
        List <POKER_INFO> prPlayPokers = proto.getPokerInfoList();

        for (int i = 0; i < prPlayPokers.Count; i++)
        {
            for (int j = 0; j < seat.pokerList.Count; ++j)
            {
                if (prPlayPokers[i].index == seat.pokerList[j].index)
                {
                    seat.pokerList[j].SetPaker(prPlayPokers[i].size, prPlayPokers[i].color);
                    playPoker.Add(seat.pokerList[j]);
                    CurrentRoom.HistoryPoker.Add(seat.pokerList[j]);//已出牌
                    //CurrentRoom.CurrPlayPoker.Add(seat.pokerList[j]);
                    seat.pokerList.RemoveAt(j);
                    break;
                }
            }
        }
        PaoDeKuaiHelper.Sort(playPoker);

        CurrentRoom.RecentlyPlayPoker = new CombinationPokersEntity(proto.pos, playPoker, PokersType.None, 0);
        PaoDeKuaiHelper.CheckPokerType(CurrentRoom.RecentlyPlayPoker);
        Debug.Log(string.Format("出牌玩家:{0} 检测牌型:{1}", seat.PlayerId, CurrentRoom.RecentlyPlayPoker.PokersType.ToString()));


        //是自己出牌
        Currhint.Reset();
        if (proto.pos == PlayerSeat.Pos)
        {
            //清空上家牌
            Currhint.Others.Reset();
        }
        else
        {
            Currhint.Others = CurrentRoom.RecentlyPlayPoker;
        }

        if (seat == PlayerSeat)
        {
            SendOperateStateChangeNotify(seat);
        }
        SendSeatInfoChangeNotify(seat);
        SetCountDown(0, seat == PlayerSeat, seat.Index, true);
        HistoryPokerChanged();
        return(CurrentRoom.RecentlyPlayPoker.PokersType);
    }
Exemplo n.º 2
0
 public PlayPokerCommand(PDK_OPERATE data)
 {
     m_DataEntity = data;
 }