示例#1
0
        /// <summary>
        /// 获得下注数据
        /// </summary>
        public void GetBetData(ISFSObject data)
        {
            CurBetData = new BetData(data);
            if (CurBetData.Seat == SelfSeat)
            {
                if (Round != BetHistory.Round)
                {
                    BetHistory.Round   = Round;
                    BetHistory.CurBets = new int[5];
                }
                switch (CurBetData.Position)
                {
                case ConstantData.KeyBetBanker:
                    BetHistory.CurBets[0] += CurBetData.Gold;
                    break;

                case ConstantData.KeyBetLeisure:
                    BetHistory.CurBets[1] += CurBetData.Gold;
                    break;

                case ConstantData.KeyBetEqual:
                    BetHistory.CurBets[2] += CurBetData.Gold;
                    break;

                case ConstantData.KeyBetBankerDouble:
                    BetHistory.CurBets[3] += CurBetData.Gold;
                    break;

                case ConstantData.KeyBetLeisureDouble:
                    BetHistory.CurBets[4] += CurBetData.Gold;
                    break;
                }
            }
        }
示例#2
0
        /// <summary>
        /// 玩家下注
        /// </summary>
        /// <param name="data"></param>
        private void OnPlayerBet(BetData data)
        {
            var        gold       = data.Gold;
            var        selfGold   = 0;
            var        chipDatas  = GetChipDatas(gold);
            var        position   = data.Position;
            var        seat       = data.Seat;
            var        areaCount  = BetAreas.Length;
            NbjlPlayer sendPlayer = null;
            BetArea    getArea    = null;
            bool       selfBet    = seat == App.GameData.SelfSeat;

            for (int i = 0; i < areaCount; i++)
            {
                BetArea area = BetAreas[i];
                if (area.AreaType == position)
                {
                    getArea = BetAreas[i];
                }
            }
            foreach (var player in ShowPlayers)
            {
                if (!player.gameObject.activeInHierarchy)
                {
                    continue;
                }
                if (player.Info != null)
                {
                    if (player.Info.Seat.Equals(seat))
                    {
                        sendPlayer = player;
                    }
                }
            }
            if (selfBet && sendPlayer == null)
            {
                App.GameData.GStatus = YxEGameStatus.PlayAndConfine;
                App.GameData.GetPlayerInfo().CoinA -= gold;
                sendPlayer = SelfPlayer;
            }
            if (sendPlayer == null)
            {
                sendPlayer = OtherPlayer;
            }
            PlayChips(sendPlayer, getArea, chipDatas, gold, selfBet);
        }
示例#3
0
 /// <summary>
 /// 流式下注
 /// </summary>
 public void GetBetDatas(ISFSObject data)
 {
     if (data.ContainsKey(ConstantData.KeyCoin))
     {
         var datas = data.GetSFSArray(ConstantData.KeyCoin);
         var count = datas.Count;
         var list  = new List <BetData>();
         for (int i = 0; i < count; i++)
         {
             ISFSObject item    = datas.GetSFSObject(i);
             var        betData = new BetData(item);
             if (betData.Seat == SelfSeat)
             {
                 continue;
             }
             list.Add(betData);
         }
         FlushBetDatas = list.ToList();
     }
 }
示例#4
0
 /// <summary>
 /// 获取重连后玩家下注情况
 /// </summary>
 private void FreshUserBet()
 {
     GameInfoBetDatas = new List <BetData>();
     foreach (var player in RoundPlayers)
     {
         if (player != null)
         {
             if (player.BetGolds != null)
             {
                 var count = player.BetGolds.Length;
                 for (int i = 0; i < count; i++)
                 {
                     BetData data = new BetData(_pos[i], player.Seat, player.BetGolds[i]);
                     if (data.Gold > 0)
                     {
                         GameInfoBetDatas.Add(data);
                     }
                 }
             }
         }
     }
 }