public void BeginBigDeal(int[] val, int dealCount = 4, Action finish = null) { _dealCount = dealCount; var gdata = App.GetGameData <PaiJiuGameData>(); var panels = gdata.PlayerList; int bankerSeat = App.GetGameData <PaiJiuGameData>().BankerSeat; //一次发4张牌,所有人都发 for (int i = 0; i < panels.Length; i++) { int dealSeat = (i + bankerSeat + 1) % panels.Length; //从初门开始发牌 for (int j = 0; j < dealCount; j++) { PaiJiuCardInfo cardInfo = new PaiJiuCardInfo { Seat = dealSeat, PokerVal = dealSeat == App.GameData.SelfSeat ? val[j] : 0, CardIndex = j }; _dealingCards.Enqueue(cardInfo); } } if (!IsBigDeal) { IsBigDeal = true; StartCoroutine(DealWinAnim()); } OnFinish = finish; }
/// <summary> /// 发出接受到的所有牌 /// </summary> public void FastDeal() { if (_dealingCards.Count <= 0) { return; } int selfSeat = App.GameData.SelfSeat; var gdata = App.GetGameData <PaiJiuGameData>(); int cardCount = _dealingCards.Count; for (int i = 0; i < cardCount; i++) { PaiJiuCardInfo pokerInfo = _dealingCards.Dequeue(); PaiJiuPlayer panel = gdata.GetPlayer <PaiJiuPlayer>(pokerInfo.Seat, true); PaiJiuCard card = DealOnes(panel.PokersTrans[pokerInfo.CardIndex], pokerInfo.PokerVal, pokerInfo.CardIndex, pokerInfo.Seat == selfSeat); panel.AddPoker(card); } }
private void BigDeal() { var main = App.GetGameManager <PaiJiuGameManager>(); var gdata = App.GetGameData <PaiJiuGameData>(); Debug.Log("===== dealcount == " + _dealCount + " , length = " + _dealingCards.Count + " ===== "); for (int i = 0; i < _dealCount; i++) { PaiJiuCardInfo pokerInfo = _dealingCards.Dequeue(); //弹出要发的牌 int cardIndex = pokerInfo.CardIndex; //发到了第几张手牌 int cardSeat = pokerInfo.Seat; //发牌人座位号 PaiJiuPlayer paiJiuPlayer = gdata.GetPlayer <PaiJiuPlayer>(cardSeat, true); Transform toPos = paiJiuPlayer.PokersTrans[cardIndex % paiJiuPlayer.PokersTrans.Length]; GameObject dealPoker = DealOnes(BigBirth, toPos, pokerInfo.PokerVal, cardSeat == App.GameData.SelfSeat, cardIndex); //发牌 PaiJiuCard pokerCard = dealPoker.GetComponent <PaiJiuCard>(); pokerCard.SetCardFront(); paiJiuPlayer.AddPoker(pokerCard); Facade.Instance <MusicManager>().Play("dealer"); main.PublicPokers.Add(pokerCard); } }