/// <summary>
        /// 发送座位信息变更消息
        /// </summary>
        /// <param name="seat"></param>
        private void SendSeatInfoChangeNotify(SeatEntity seat)
        {
            if (seat == null)
            {
                return;
            }
            TransferData data = new TransferData();

            data.SetValue("SeatIndex", seat.Index);
            data.SetValue("SeatPos", seat.Pos);
            data.SetValue("PlayerId", seat.PlayerId);
            data.SetValue("Avatar", seat.Avatar);
            data.SetValue("Gold", seat.Gold);
            data.SetValue("IsPlayer", seat == PlayerSeat);
            data.SetValue("Nickname", seat.Nickname);
            //data.SetValue("PokerList", seat.pokerList);
            data.SetValue("IsReady", seat.isReady);
            data.SetValue("Bet", seat.bet);
            data.SetValue("RoomStatus", CurrentRoom.SszRoomStatus);
            data.SetValue("SeatEntity", seat);
            SendNotification(ON_SEAT_INFO_CHANGED, data);
        }
Esempio n. 2
0
 public void SetUI(SeatEntity seat)
 {
     m_SeatPos = seat.Pos;
     SetPlayerInfo(seat);
 }
 /// <summary>
 /// 组合牌结束
 /// </summary>
 /// <param name="data"></param>
 public void GroupPokerShow(TransferData data)
 {
     SeatEntity seat = data.GetValue<SeatEntity>("Seat");
     m_Seats[seat.Index].GroupPokerShow();
 }
        public const int ROOM_SEAT_COUNT = 4; //房间座位数量


        public void InitRoom(SSS_CREATE_ROOM proto)
        {
            //CurrentRoom = room;
            //CalculateSeatIndexOne();  //普通场计算座位 Index
            //SendRoomInfoChangeNotify();
            CurrentRoom = new RoomEntity()
            {
                roomId        = proto.roomInfo.roomId,
                currentLoop   = proto.roomInfo.loop,
                maxLoop       = proto.roomInfo.maxLoop,
                SszRoomStatus = proto.roomInfo.roomStatus,
                BaseScore     = proto.roomInfo.baseScore,//底分
                SeatCount     = proto.roomInfo.seatInfoCount(),
                gameId        = GameCtrl.Instance.CurrentGameId,
                groupId       = 0,
                matchId       = 0,
                SeatList      = new List <SeatEntity>(),
            };
            Debug.Log(proto.roomInfo.seatInfoCount() + "              座位长度");
            for (int i = 0; i < proto.roomInfo.seatInfoCount(); ++i)
            {
                SEAT_INFO  ssz_seat = proto.roomInfo.getSeatInfo(i);
                SeatEntity seat     = new SeatEntity();

                seat.PlayerId = ssz_seat.playerId;//玩家ID
                if (seat.PlayerId == AccountProxy.Instance.CurrentAccountEntity.passportId)
                {
                    seat.IsPlayer = true;
                }
                Debug.Log(ssz_seat.nickname + "              玩家名字");
                seat.Nickname        = ssz_seat.nickname;   //玩家名字
                seat.Avatar          = ssz_seat.avatar;     //玩家头像
                seat.Gender          = ssz_seat.gender;     //玩家性别
                seat.Gold            = ssz_seat.gold;       //底分
                seat.Pos             = ssz_seat.pos;        //座位位置
                seat.seatStatus      = ssz_seat.seatStatus; //座位状态
                seat.handPokerList   = new List <Poker>();
                seat.firstPokerList  = new List <Poker>();
                seat.middlePokerList = new List <Poker>();
                seat.endPokerList    = new List <Poker>();
                for (int j = 0; j < ssz_seat.firstPokerInfoCount(); ++j)
                {
                    FIRST_POKER_INFO firstPoker = ssz_seat.getFirstPokerInfo(j);
                    seat.firstPokerList.Add(new Poker(firstPoker.index, firstPoker.color, firstPoker.size));
                }
                for (int j = 0; j < ssz_seat.secondPokerInfoCount(); ++j)
                {
                    SECOND_POKER_INFO middlePoker = ssz_seat.getSecondPokerInfo(j);
                    seat.middlePokerList.Add(new Poker(middlePoker.index, middlePoker.color, middlePoker.size));
                }
                for (int j = 0; j < ssz_seat.thirdPokerInfoCount(); ++j)
                {
                    THIRD_POKER_INFO endPoker = ssz_seat.getThirdPokerInfo(j);
                    seat.endPokerList.Add(new Poker(endPoker.index, endPoker.color, endPoker.size));
                }
                CurrentRoom.SeatList.Add(seat);
            }
            if (proto.roomInfo.seatInfoCount() == 3)
            {
                CurrentRoom.SeatList.Add(new SeatEntity());
            }
            CalculateSeatIndexOne();
        }