Пример #1
0
        /// <summary>
        /// 获得被开牌方座位
        /// </summary>
        /// <returns></returns>
        private Seat GetOnlyOpponentSeat()
        {
            List <Seat> seats          = JoinSeats.FindAll(s => s.IPlayer.Id != CurrentSeat.IPlayer.Id);
            List <Seat> notGaveupSeats = new List <Seat>();

            for (int i = 0; i < seats.Count; i++)
            {
                if (seats[i].IsGaveUp)
                {
                    continue;
                }
                notGaveupSeats.Add(seats[i]);
            }
            if (notGaveupSeats.Count != 1)
            {
                return(null);
            }
            return(seats[0]);
        }
Пример #2
0
        /// <summary>
        /// 获得被开牌方座位
        /// </summary>
        /// <returns></returns>
        private Seat GetOnlyOpponentSeat(int playerId)
        {
            List <Seat> seats = JoinSeats.FindAll(s => s.IPlayer.Id != playerId && s.IsGaveUp != true);

            //List<Seat> notGaveupSeats = new List<Seat>();
            //for (int i = 0; i < seats.Count; i++) {
            //    if (seats[i].IsGaveUp) {
            //        continue;
            //    }
            //    notGaveupSeats.Add(seats[i]);
            //}
            //if (notGaveupSeats.Count != 1) {
            //    return null;
            //}
            if (seats.Count != 1)
            {
                return(null);
            }
            return(seats[0]);
        }
Пример #3
0
        /// <summary>
        /// 没有放弃的玩家数量
        /// </summary>
        private int GetActiveSeatCount()
        {
            int count = JoinSeats.FindAll(s => s.IsGaveUp == false).Count();

            return(count);
        }
Пример #4
0
 /// <summary>
 /// 返回每局参与玩家
 /// </summary>
 /// <returns></returns>
 private List <Seat> GetPlaySeats()
 {
     return(JoinSeats.FindAll(p => p.IsChipIned == true));
 }