public void SetRoom(JY_ROOM prRoom) { if (prRoom.hasStatus()) { roomStatus = prRoom.status; } if (prRoom.hasLoop()) { currentLoop = prRoom.loop; } if (prRoom.hasMaxLoop()) { maxLoop = prRoom.maxLoop; } if (prRoom.hasBaseScore()) { baseScore = prRoom.baseScore; } if (prRoom.hasIsBomb()) { isBaoGuo = prRoom.isBomb; } //if (prRoom.hasUnixtime())//----------------------------------------------------时间戳 //{ // Unixtime = prRoom.unixtime; //} //if (prRoom.hasRemainMahjong()) //{ // remainMahjong = prRoom.remainMahjong; //} //if (prRoom.hasLoopEnd()) //{ // loopEnd = prRoom.loopEnd; //} //if (prRoom.hasMahJongSum()) //{ // mahJongSum = prRoom.mahJongSum; //} List <JY_SEAT> prPokerList = prRoom.getSeatListList(); for (int i = 0; i < prPokerList.Count; i++) { if (prPokerList[i] != null && (prPokerList[i].pos > 0 || prPokerList[i].playerId > 0)) { //--------------1----------------- for (int j = 0; j < SeatList.Count; j++) { if (prPokerList[i].pos == SeatList[j].Pos) { SeatList[j].SetSeat(prPokerList[i]); break; } } } } }
/// <summary> /// 初始化房间 /// </summary> /// <param name="prRoom"></param> public void InitRoom(JY_ROOM prRoom) { //RoomMaJiangProxy.Instance CurrentRoom = new RoomEntity() { currentLoop = prRoom.loop, maxLoop = prRoom.maxLoop, roomId = prRoom.roomId, //matchId = prRoom.matchId, roomStatus = prRoom.status, baseScore = prRoom.baseScore, }; //房间配置 CurrentRoom.Config.Clear(); for (int i = 0; i < prRoom.settingIdCount(); ++i) { cfg_settingEntity settingEntity = cfg_settingDBModel.Instance.Get(prRoom.getSettingId(i)); if (settingEntity != null) { CurrentRoom.Config.Add(settingEntity); } } //RoomPaiJiuProxy //创建座位 CurrentRoom.SeatList = new List <SeatEntity>(); for (int i = 0; i < prRoom.seatListCount(); i++) { JY_SEAT jySeat = prRoom.getSeatList(i); SeatEntity seat = new SeatEntity(); //手牌 for (int j = 0; j < jySeat.pokerListCount(); j++) { seat.PokerList.Add(new Poker()); } seat.SetSeat(jySeat); CurrentRoom.SeatList.Add(seat); if (seat.IsBanker) { BankerSeat = seat; } } //(时间戳) if (prRoom.hasUnixtime()) { CurrentRoom.Unixtime = prRoom.unixtime; } CalculateSeatIndex(); PeopleCounting(); }