예제 #1
0
 /// <summary>
 /// Ф:Проверяет ситуацию, когда кто-то сделал рейз из позней позиции в неоткрытом банке
 /// </summary>
 public static bool WasStealToPlayer(this Game game, PlayerHistory ph)
 {
     var playersInStealSituations =
         game.PlayerHistories.Where(p => p.PlayerName != ph.PlayerName && game.IsStealSituationForPlayer(p));
     return playersInStealSituations.Any(p=>p.HandActions.RealActions().First().IsRaiseAction());
 }
예제 #2
0
 public virtual List<PlayerHistory> ParsePlayers(Game game, IReadOnlyList<string> multipleLines)
 {
     var players = new List<PlayerHistory>();
     for (var i = 0; i < game.NumberOfPlayers; i++)
     {
         string oneLine = multipleLines[StartPlayerRow + i];
         var player = new PlayerHistory
         {
             GameNumber = game.GameNumber,
             PlayerName = FindPlayerName(oneLine),
             SeatNumber = FindSeatNumber(oneLine),
             StartingStack = FindPlayerStartingStack(oneLine),
             HoleCards = new byte[2],
             HandActions = new List<HandAction>(),
             Game = game
         };
         players.Add(player);
     }
     InitializePositionsOfPlayers(players,game.ButtonPosition);
     return players;
 }
예제 #3
0
        /// <summary>
        /// Ф:Проверяет стиллинговую ситуацию для игрока
        /// </summary>
        public static bool IsStealSituationForPlayer(this Game game, PlayerHistory playerHistory)
        {
            var playersCount = game.PlayerHistories.Count;
            if (playersCount < 3)
                return false;
            if (!playerHistory.HandActions.PreflopHandActions().RealActions().Any())
                return false;
            if (!playerHistory.IsInStealPosition())
                return false;
            var allPreflopHandActions = game.AllPreflopHandActions().RealActions().ToList();
            var positionAction = allPreflopHandActions.Where(ha => ha.PlayerName == playerHistory.PlayerName).OrderBy(ha => ha.Index).First();

            if (!allPreflopHandActions.AllFoldedBeforeAction(positionAction))
                return false;
            return true;
        }