/// <summary> /// 客户端发送配牌 /// </summary> public void PlayPoker() { bool isAsk = DeckRules.AskIsPlayPoker(RoomShiSanZhangProxy.Instance.PlayerSeat.firstPokerList, RoomShiSanZhangProxy.Instance.PlayerSeat.middlePokerList); bool isAsk1 = DeckRules.AskIsPlayPoker(RoomShiSanZhangProxy.Instance.PlayerSeat.middlePokerList, RoomShiSanZhangProxy.Instance.PlayerSeat.endPokerList); Debug.Log(isAsk + " " + isAsk1 + " 检测的牌型"); if (isAsk && isAsk1) { SSS_PLAY_GET proto = new SSS_PLAY_GET(); proto.seatInfo = new SEAT_INFO(); for (int i = 0; i < RoomShiSanZhangProxy.Instance.PlayerSeat.firstPokerList.Count; i++) { FIRST_POKER_INFO firstPoker = new FIRST_POKER_INFO(); firstPoker.size = RoomShiSanZhangProxy.Instance.PlayerSeat.firstPokerList[i].Size; firstPoker.color = RoomShiSanZhangProxy.Instance.PlayerSeat.firstPokerList[i].Color; firstPoker.index = RoomShiSanZhangProxy.Instance.PlayerSeat.firstPokerList[i].Index; proto.seatInfo.addFirstPokerInfo(firstPoker); } for (int i = 0; i < RoomShiSanZhangProxy.Instance.PlayerSeat.middlePokerList.Count; i++) { SECOND_POKER_INFO twoPoker = new SECOND_POKER_INFO(); twoPoker.size = RoomShiSanZhangProxy.Instance.PlayerSeat.middlePokerList[i].Size; twoPoker.color = RoomShiSanZhangProxy.Instance.PlayerSeat.middlePokerList[i].Color; twoPoker.index = RoomShiSanZhangProxy.Instance.PlayerSeat.middlePokerList[i].Index; proto.seatInfo.addSecondPokerInfo(twoPoker); } for (int i = 0; i < RoomShiSanZhangProxy.Instance.PlayerSeat.endPokerList.Count; i++) { THIRD_POKER_INFO threePoker = new THIRD_POKER_INFO(); threePoker.size = RoomShiSanZhangProxy.Instance.PlayerSeat.endPokerList[i].Size; threePoker.color = RoomShiSanZhangProxy.Instance.PlayerSeat.endPokerList[i].Color; threePoker.index = RoomShiSanZhangProxy.Instance.PlayerSeat.endPokerList[i].Index; proto.seatInfo.addThirdPokerInfo(threePoker); } NetWorkSocket.Instance.Send(proto.encode(), SSS_PLAY.CODE, GameCtrl.Instance.SocketHandle); } else { UITipPokerShiSanZhangView.Instance.FalseHints(); } }
public bool LegalCheckDeck(DeckRules testRules) { // TODO: Check deck properties against the given rule set return(true); }
/// <summary> /// 提示 /// </summary> /// <param name="obj"></param> private void OnTipPoker(object[] obj) { if (RoomShiSanZhangProxy.Instance.PlayerSeat == null) { return; } DeckType deckType = (DeckType)obj[0]; if (deckType == DeckType.DUI_ZI) { if (TipDui == null || TipDui.Count == 0) { TipDui = DeckRules.GetAllDuiZi(RoomShiSanZhangProxy.Instance.PlayerSeat.handPokerList); TipIndexDui = 0; if (TipDui == null || TipDui.Count == 0) { return; } } UITipPokerShiSanZhangView.Instance.SelectPoker(TipDui[TipIndexDui].pokers); ++TipIndexDui; if (TipIndexDui == TipDui.Count) { TipIndexDui = 0; } } else if (deckType == DeckType.LIANG_DUI) { if (TipLiangDui == null || TipLiangDui.Count == 0) { TipLiangDui = DeckRules.GetAllLiangDui(RoomShiSanZhangProxy.Instance.PlayerSeat.handPokerList); TipIndexLiangDui = 0; if (TipLiangDui == null || TipLiangDui.Count == 0) { return; } } UITipPokerShiSanZhangView.Instance.SelectPoker(TipLiangDui[TipIndexLiangDui].pokers); ++TipIndexLiangDui; if (TipIndexLiangDui == TipLiangDui.Count) { TipIndexLiangDui = 0; } } else if (deckType == DeckType.SAN_TIAO) { if (TipSanTiao == null || TipSanTiao.Count == 0) { TipSanTiao = DeckRules.GetAllSanTiao(RoomShiSanZhangProxy.Instance.PlayerSeat.handPokerList); TipIndexSanTiao = 0; if (TipSanTiao == null || TipSanTiao.Count == 0) { return; } } UITipPokerShiSanZhangView.Instance.SelectPoker(TipSanTiao[TipIndexSanTiao].pokers); ++TipIndexSanTiao; if (TipIndexSanTiao == TipSanTiao.Count) { TipIndexSanTiao = 0; } UITipPokerShiSanZhangView.Instance.TipKuang(); } else if (deckType == DeckType.SHUN_ZI) { if (TipShunZi == null || TipShunZi.Count == 0) { TipShunZi = DeckRules.GetAllShunZi(RoomShiSanZhangProxy.Instance.PlayerSeat.handPokerList); TipIndexShunZi = 0; if (TipShunZi == null || TipShunZi.Count == 0) { return; } } UITipPokerShiSanZhangView.Instance.SelectPoker(TipShunZi[TipIndexShunZi].pokers); ++TipIndexShunZi; if (TipIndexShunZi == TipShunZi.Count) { TipIndexShunZi = 0; } UITipPokerShiSanZhangView.Instance.TipKuang(); } else if (deckType == DeckType.TONG_HUA) { if (TipTongHua == null || TipTongHua.Count == 0) { TipTongHua = DeckRules.GetAllTongHua(RoomShiSanZhangProxy.Instance.PlayerSeat.handPokerList); TipIndexTongHua = 0; if (TipTongHua == null || TipTongHua.Count == 0) { return; } } UITipPokerShiSanZhangView.Instance.SelectPoker(TipTongHua[TipIndexTongHua].pokers); ++TipIndexTongHua; if (TipIndexTongHua == TipTongHua.Count) { TipIndexTongHua = 0; } UITipPokerShiSanZhangView.Instance.TipKuang(); } else if (deckType == DeckType.TIE_ZHI) { if (TipTieZhi == null || TipTieZhi.Count == 0) { TipTieZhi = DeckRules.GetAllTieZhi(RoomShiSanZhangProxy.Instance.PlayerSeat.handPokerList); TipIndexTieZhi = 0; if (TipTieZhi == null || TipTieZhi.Count == 0) { return; } } UITipPokerShiSanZhangView.Instance.SelectPoker(TipTieZhi[TipIndexTieZhi].pokers); ++TipIndexTieZhi; if (TipIndexTieZhi == TipTieZhi.Count) { TipIndexTieZhi = 0; } } else if (deckType == DeckType.HU_LU) { if (TipHuLu == null || TipHuLu.Count == 0) { TipHuLu = DeckRules.GetAllHuLu(RoomShiSanZhangProxy.Instance.PlayerSeat.handPokerList); TipIndexHuLu = 0; if (TipHuLu == null || TipHuLu.Count == 0) { return; } } UITipPokerShiSanZhangView.Instance.SelectPoker(TipHuLu[TipIndexHuLu].pokers); ++TipIndexHuLu; if (TipIndexHuLu == TipHuLu.Count) { TipIndexHuLu = 0; } UITipPokerShiSanZhangView.Instance.TipKuang(); } else if (deckType == DeckType.TONG_HUA_SHUN) { if (TipTongHuaShun == null || TipTongHuaShun.Count == 0) { TipTongHuaShun = DeckRules.GetAllTongHuaShun(RoomShiSanZhangProxy.Instance.PlayerSeat.handPokerList); TipIndexTongHuaShun = 0; if (TipTongHuaShun == null || TipTongHuaShun.Count == 0) { return; } } UITipPokerShiSanZhangView.Instance.SelectPoker(TipTongHuaShun[TipIndexTongHuaShun].pokers); ++TipIndexTongHuaShun; if (TipIndexTongHuaShun == TipTongHuaShun.Count) { TipIndexTongHuaShun = 0; } UITipPokerShiSanZhangView.Instance.TipKuang(); } }