Exemple #1
0
 private List <Card> GetCards(FlopBoard flopBoard, HoldingHoles heroHoles)
 {
     return(new List <Card>()
     {
         flopBoard.Flop1, flopBoard.Flop2, flopBoard.Flop3, heroHoles.Hole1, heroHoles.Hole2
     });
 }
Exemple #2
0
        private GridStatusInBoardRange TestGrid(FlopBoard flopBoard, RangeGrid grid)
        {
            var result     = new GridStatusInBoardRange(grid.Category);
            var rankTester = GetGridRankTester(flopBoard);
            var rankResult = rankTester.Invoke(grid);

            result.RankWiseStatus = rankResult;

            switch (result.Category)
            {
            case GridCategoryEnum.Suited:
                result.SuitedStatus = GetSuitedTester(flopBoard).Invoke(grid);
                break;

            case GridCategoryEnum.Paired:
                result.PairedStatus = GetPairedTester(flopBoard).Invoke(grid);
                break;

            case GridCategoryEnum.Offsuit:
                result.OffsuitStatus = GetOffsuitTester(flopBoard).Invoke(grid);
                break;
            }

            return(result);
        }
Exemple #3
0
        public bool ShouldAGridFoldToBoardByRank(RangeGrid grid, FlopBoard flopBoard)
        {
            switch (flopBoard.RankTexture)
            {
            case FlopBoardRankTextureEnum.ThreeSome:
                return(new ThreeSomeRankTexture(flopBoard).ShouldAGridFoldToBet(grid));

            case FlopBoardRankTextureEnum.HighPair:
                return(new HighPairRankTexture(flopBoard).ShouldAGridFoldToBet(grid));

            case FlopBoardRankTextureEnum.LowPair:
                return(new LowPairRankTexture(flopBoard).ShouldAGridFoldToBet(grid));

            case FlopBoardRankTextureEnum.Singles:
                return(new SinglesRankTexture(flopBoard).ShouldAGridFoldToBet(grid));
            }
            throw new NotImplementedException();
        }
Exemple #4
0
        private BoardRangeGridStatusEnum TestGrid(FlopBoard flopBoard, RangeGrid grid)
        {
            switch (flopBoard.RankTexture)
            {
            case FlopBoardRankTextureEnum.ThreeSome:
                return(new ThreeSomeRankTexture(flopBoard).TestGridAgainstFlopBoard(grid));

            case FlopBoardRankTextureEnum.HighPair:
                return(new HighPairRankTexture(flopBoard).TestGridAgainstFlopBoard(grid));

            case FlopBoardRankTextureEnum.LowPair:
                return(new LowPairRankTexture(flopBoard).TestGridAgainstFlopBoard(grid));

            case FlopBoardRankTextureEnum.Singles:
                return(new SinglesRankTexture(flopBoard).TestGridAgainstFlopBoard(grid));
            }
            throw new NotImplementedException();
        }
Exemple #5
0
        private Func <RangeGrid, BoardRangeGridStatusEnum> GetGridRankTester(FlopBoard flopBoard)
        {
            switch (flopBoard.RankTexture)
            {
            case FlopBoardRankTextureEnum.ThreeSome:
                return(new ThreeSomeRankTexture(flopBoard).TestGridAgainstFlopBoard);

            case FlopBoardRankTextureEnum.HighPair:
                return(new HighPairRankTexture(flopBoard).TestGridAgainstFlopBoard);

            case FlopBoardRankTextureEnum.LowPair:
                return(new LowPairRankTexture(flopBoard).TestGridAgainstFlopBoard);

            case FlopBoardRankTextureEnum.Singles:
                return(new SinglesRankTexture(flopBoard).TestGridAgainstFlopBoard);

            default:
                throw new NotImplementedException();
            }
        }
Exemple #6
0
        public Dictionary <Tuple <SuitEnum, SuitEnum>, bool> ShouldAGridFoldToBoardBySuit(RangeGrid grid,
                                                                                          FlopBoard flopBoard, HoldingHoles heroHoles)
        {
            var conflictCards = new List <Card>()
            {
                heroHoles.Hole1, heroHoles.Hole2, flopBoard.Flop1, flopBoard.Flop2, flopBoard.Flop3
            };

            grid.EliminateConflicts(conflictCards);
            switch (flopBoard.SuitTexture)
            {
            case FlopBoardSuitTextureEnum.SuitedThree:
                return(new SuitedThreeSuitTexture(flopBoard).ShouldAGridFoldToBet(grid));

            case FlopBoardSuitTextureEnum.SuitedTwo:
                return(new SuitedTwoSuitTexture(flopBoard).ShouldAGridFoldToBet(grid));

            case FlopBoardSuitTextureEnum.Rainbow:
                return(new RainbowSuitTexture().ShouldAGridFoldToBet(grid));

            default:
                throw new InvalidOperationException();
            }
        }
Exemple #7
0
 private PlayerRange SqueezeOnCheck(PlayerRange previousRange, Move lastMove, int bigBlindSize, FlopBoard flopBoard, HoldingHoles heroHoles)
 {
     return(_playerRangeSqueezer.Squeeze(previousRange, grid => TestGrid(flopBoard, grid), TestOutcomeOnCheck, GetCards(flopBoard, heroHoles)));
 }
Exemple #8
0
        private Func <RangeGrid, OffsuitStatus <BoardRangeGridStatusEnum> > GetOffsuitTester(FlopBoard flopBoard)
        {
            switch (flopBoard.SuitTexture)
            {
            case FlopBoardSuitTextureEnum.SuitedThree:
                return(new SuitedThreeSuitTexture(flopBoard).TestOffsuitGrid);

            case FlopBoardSuitTextureEnum.SuitedTwo:
                return(new SuitedTwoSuitTexture(flopBoard).TestOffsuitGrid);

            case FlopBoardSuitTextureEnum.Rainbow:
                return(new RainbowSuitTexture().TestOffsuitGrid);

            default:
                throw new NotImplementedException();
            }
        }
Exemple #9
0
        public PlayerRange Squeeze(PlayerRange previousRange, Move lastMove, int bigBlindSize, FlopBoard flopBoard, HoldingHoles heroHoles)
        {
            Logger.Instance.Log($"Squeezing {lastMove.Player.Name}'s range based on his {lastMove.Decision.DecisionType} with {lastMove.Decision.ChipsAdded} chips");
            switch (lastMove.Decision.DecisionType)
            {
            case DecisionType.AllIn:
            case DecisionType.AllInRaise:
            case DecisionType.Raise:
            case DecisionType.Reraise:
                return(SqueezeOnRaise(previousRange, lastMove, bigBlindSize, flopBoard, heroHoles));

            case DecisionType.Ante:
                return(previousRange);

            case DecisionType.Call:
                return(SqueezeOnCall(previousRange, lastMove, bigBlindSize, flopBoard, heroHoles));

            case DecisionType.Check:
                return(SqueezeOnCheck(previousRange, lastMove, bigBlindSize, flopBoard, heroHoles));

            default:
                throw new InvalidOperationException($"{lastMove.Decision.DecisionType} should not show in Preflop Squeeze");
            }
        }
 public FlopFiveCardsEnumerator(FlopBoard flopBoard, HoldingHoles heroHoles)
 {
     FlopBoard = flopBoard;
     HeroHoles = heroHoles;
 }