public void Reset() { Poker = null; CloseTip(); SetUniversal(false, false); m_Model.transform.localEulerAngles = Vector3.zero; m_Model.transform.localPosition = Vector3.zero; m_Model.transform.localScale = Vector3.one; m_isHold = false; m_isShow = false; isGray = false; isSelect = false; m_isPlayingAnimation = false; }
/// <summary> /// 显示吃碰杠胡 /// </summary> /// <param name="pbGroup"></param> public void ShowOperate(List <PokerCombinationEntity> pbGroup) { if (pbGroup == null) { throw new Exception("服务器询问吃碰杠的列表是空的"); } RoomMaJiangProxy.Instance.AskPokerGroup = pbGroup; bool canHu = false; bool isZiMo = false; List <Poker> lstPeng = null; List <List <Poker> > lstGangs = null; List <List <Poker> > lstChi = null; List <List <Poker> > lstZhiDui = null; List <List <Poker> > lstChiTing = null; List <Poker> lstPengTing = null; List <List <Poker> > lstLiangXi = null; bool isMustZhiDui = false; bool canDingZhang = false; bool canDingJiang = false; List <List <Poker> > lstKou = null; List <Poker> lstBuXi = null; bool canPiaoTing = false; bool isPao = false; bool isJiao = false; bool isMingTi = false; for (int i = 0; i < pbGroup.Count; ++i) { OperatorType type = pbGroup[i].CombinationType; Debug.Log("客户端可以" + type); Poker poker = null; if (pbGroup[i].PokerList.Count > 0) { poker = pbGroup[i].PokerList[0]; Debug.Log(poker.ToString("{0}_{1}_{2}")); } switch (type) { case OperatorType.Peng: lstPeng = RoomMaJiangProxy.Instance.GetPeng(poker); if (lstPeng == null || lstPeng.Count == 0) { AppDebug.ThrowError("没检测出来可以碰"); } break; case OperatorType.Gang: if (poker == null) { lstGangs = RoomMaJiangProxy.Instance.GetAnGang(); List <Poker> lstBuGangs = RoomMaJiangProxy.Instance.GetBuGang(); for (int j = 0; j < lstBuGangs.Count; ++j) { lstGangs.Add(new List <Poker> { lstBuGangs[j] }); } } else { lstGangs = RoomMaJiangProxy.Instance.GetMingGang(poker); } if (lstGangs == null || lstGangs.Count == 0) { AppDebug.ThrowError("没检测出来可以杠,服务器发送的poker是" + (poker == null ? "空的" : poker.ToString())); } break; case OperatorType.Chi: lstChi = RoomMaJiangProxy.Instance.GetChi(poker); if (lstChi == null || lstChi.Count == 0) { AppDebug.ThrowError("没检测出来可以吃"); } break; case OperatorType.Hu: canHu = true; isZiMo = pbGroup[i].SubTypeId == 2; break; case OperatorType.ZhiDui: lstZhiDui = RoomMaJiangProxy.Instance.GetZhiDui(out isMustZhiDui); break; case OperatorType.ChiTing: lstChiTing = RoomMaJiangProxy.Instance.GetChiTing(poker); if (lstChiTing == null || lstChiTing.Count == 0) { AppDebug.ThrowError("没检测出来可以吃听"); } break; case OperatorType.PengTing: lstPengTing = RoomMaJiangProxy.Instance.GetPengTing(poker); if (lstPengTing == null || lstPengTing.Count == 0) { AppDebug.ThrowError("没检测出来可以碰听"); } break; case OperatorType.LiangXi: lstLiangXi = RoomMaJiangProxy.Instance.GetLiangXi(); if (lstLiangXi == null || lstLiangXi.Count == 0) { AppDebug.ThrowError("没检测出来可以亮喜"); } break; case OperatorType.DingZhang: canDingZhang = true; break; case OperatorType.FengGang: List <Poker> lstFengGang = RoomMaJiangProxy.Instance.GetFengGang(); if (lstFengGang != null) { if (lstGangs == null) { lstGangs = new List <List <Poker> >(); } lstGangs.Add(lstFengGang); } break; case OperatorType.DingJiang: Poker dingjiang = RoomMaJiangProxy.Instance.GetDingJiang(poker); if (dingjiang != null) { canDingJiang = true; } break; case OperatorType.Kou: lstKou = RoomMaJiangProxy.Instance.GetKou(); break; case OperatorType.BuXi: lstBuXi = RoomMaJiangProxy.Instance.GetBuXi(); if (lstBuXi == null || lstBuXi.Count == 0) { AppDebug.ThrowError("没检测出来可以补喜"); } break; case OperatorType.PiaoTing: canPiaoTing = true; break; case OperatorType.Pao: isPao = true; break; case OperatorType.Jiao: isJiao = true; break; case OperatorType.MingTi: isMingTi = true; break; } } if (UIViewManager.Instance.CurrentUIScene is UISceneMaJiangView) { if (lstZhiDui != null) { UIItemOperator.Instance.ShowZhiDui(lstZhiDui, !isMustZhiDui); } else { UIItemOperator.Instance.Show(lstChi, lstPeng, lstGangs, canHu, isZiMo, lstChiTing, lstPengTing, lstLiangXi, canDingZhang, canDingJiang, lstKou, lstBuXi, canPiaoTing, isPao, isJiao, isMingTi); } } }
/// <summary> /// 初始化 /// </summary> /// <param name="poker"></param> /// <param name="isUniversal"></param> public void Init(Poker poker, bool isUniversal) { Reset(); Poker = poker; SetUniversal(isUniversal, RoomMaJiangProxy.Instance.CurrentRoom.PokerTotalPerPlayer == 17); }
public PlayPokerCommand(int playerId, Poker poker, bool isTing) { m_PlayerId = playerId; m_PlayPoker = poker; m_isTing = isTing; }
public LuckPokerCommand(Poker poker) { m_Poker = poker; }
public IncomeDetailEntity(int typeId, int times, Poker poker) { this.typeId = typeId; this.times = times; this.poker = poker; }
public void Settle(List <SeatEntity> seats, int playerSeatPos, int currentLoop, int maxLoop, List <Poker> prob, int matchId, Poker luckPoker, bool isQuan, bool isOver, int roomId, string huTaiCount, bool isFeng) { m_TxtGameLoop.SafeSetText(string.Format("游戏局数:{0}/{1}", currentLoop.ToString(), maxLoop.ToString())); m_TxtRoomId.SafeSetText("房间Id:" + roomId.ToString()); bool isZimo = true; int bankerPos = 0; for (int i = 0; i < seats.Count; ++i) { if (seats[i].isLoser) { isZimo = false; } if (seats[i].IsBanker) { bankerPos = seats[i].Pos; } } if (!string.IsNullOrEmpty(huTaiCount)) { m_TextTaiSetting.SafeSetText("胡台数:" + huTaiCount); } for (int i = 0; i < m_Cache.Count; ++i) { m_Cache[i].gameObject.SetActive(false); } UIViewManager.Instance.LoadItemAsync("UIItemHuInfo", (GameObject prefab) => { for (int i = 0; i < seats.Count; ++i) { SeatEntity seat = seats[i]; UIItemSettleSeatInfo info = null; if (i < m_Cache.Count) { info = m_Cache[i]; info.gameObject.SetActive(true); } else { GameObject go = Instantiate(prefab); go.SetParent(m_HuInfoContainer); info = go.GetComponent <UIItemSettleSeatInfo>(); m_Cache.Add(info); } info.SetUI(seat.Pos, seat.Pos == playerSeatPos, seat.Avatar, seat.Nickname, seat.Gold, seat.Settle, seat.IsBanker, seat.PokerList, seat.HitPoker, seat.UsedPokerList, seat.SettleInfo, seat.HuScoreDetail, seat.isWiner, prob, seat.ProbMulti, seat.isLoser, isZimo, seat.UniversalList, seat.TotalHuScore, luckPoker, seat.IsTing, seat.HoldPoker, bankerPos, isFeng, seat.DeskTopPoker, seat.Direction); } }); if (RoomMaJiangProxy.Instance.CurrentRoom.isReplay) { m_Page1.SetActive(false); m_Page2.SetActive(false); m_Page3.SetActive(true); } else { m_Page1.SetActive(!isOver); m_Page2.SetActive(isOver); m_Page3.SetActive(false); if (!isOver) { m_isAutoClick = true; m_fCountDown = matchId > 0 ? AUTO_READY_COUNT_DOWN : AUTO_READY_COUNT_DOWN_COMMON; m_fTimer = Time.time; } } }