コード例 #1
0
 public void ReloadPlayer()
 {
     while (PlayerDoneQueue.Count > 0)
     {
         var p = PlayerDoneQueue.Dequeue();
         if (p.PlayerStauts >= 0)
         {
             p.PlayerStauts = PlayerStauts.PrepareBet;
             PlayerQueue.Enqueue(p);
         }
         else
         {
             PlayerQuitQueue.Enqueue(p);
         }
     }
 }
コード例 #2
0
        /// <summary>
        /// 一局开始缓存玩家,根据GameInfo需要对玩家重新排列
        /// </summary>
        /// <param name="PlayerList"></param>
        public void SetCachePlayer(List <ERoomUser> PlayerList, EGameInfo gi)
        {
            InitQueue();

            var p = PlayerList[gi.FirstPlayerIndex];

            PlayerQueue.Enqueue(p);
            int i = gi.FirstPlayerIndex + 1;

            while (PlayerQueue.Count < PlayerList.Count)
            {
                if (i == PlayerList.Count)
                {
                    i = 0;
                }
                p = PlayerList[i];
                PlayerQueue.Enqueue(p);
            }
        }