示例#1
0
        public LowTriHighPairRankTexture(RiverBoard board)
        {
            TurnBoard = board.TurnBoard;
            switch (TurnBoard.RankTexture)
            {
            case TurnBoardRankTextureEnum.LowTri:
                var lowTriTexture = new Turn.TurnBoardRankTextures.LowTriRankTexture(TurnBoard);
                TriCard1 = lowTriTexture.TriCard1;
                TriCard2 = lowTriTexture.TriCard2;
                TriCard3 = lowTriTexture.TriCard3;
                if (lowTriTexture.SingleCard.Rank != board.River.Rank)
                {
                    throw new InvalidOperationException();
                }
                PairCard1 = lowTriTexture.SingleCard;
                PairCard2 = board.River;
                break;

            case TurnBoardRankTextureEnum.TwoPairs:
                var twoPairsTexture = new TwoPairsRankTexture(TurnBoard);
                if (twoPairsTexture.LowPairCard1.Rank != board.River.Rank)
                {
                    throw new InvalidOperationException();
                }
                TriCard1  = twoPairsTexture.LowPairCard1;
                TriCard2  = twoPairsTexture.LowPairCard2;
                TriCard3  = board.River;
                PairCard1 = twoPairsTexture.HighPairCard1;
                PairCard2 = twoPairsTexture.HighPairCard2;
                break;

            default:
                throw new InvalidOperationException();
            }
        }
示例#2
0
        public GridHitNewRoundResultEnum HitRiver(RangeGrid grid)
        {
            RankHandGradeEnum turnGrade;
            int turnInvolved;

            switch (TurnBoard.RankTexture)
            {
            case TurnBoardRankTextureEnum.LowTri:
                var lowTriTuple = new Turn.TurnBoardRankTextures.LowTriRankTexture(TurnBoard).TestGridAgainstBoard(grid);
                turnGrade    = lowTriTuple.Item1.Grade();
                turnInvolved = lowTriTuple.Item2;
                break;

            case TurnBoardRankTextureEnum.TwoPairs:
                var twoPairsTuple = new Turn.TurnBoardRankTextures.TwoPairsRankTexture(TurnBoard).TestGridAgainstBoard(grid);
                turnGrade    = twoPairsTuple.Item1.Grade();
                turnInvolved = twoPairsTuple.Item2;
                break;

            default:
                throw new InvalidOperationException($"Impossible to have {TurnBoard.RankTexture}");
            }
            var riverTuple        = TestGridAgainstBoard(grid);
            var riverOutcomeGrade = riverTuple.Item1.Grade();
            var riverInvolved     = riverTuple.Item2;

            if (riverOutcomeGrade > turnGrade)
            {
                return((riverInvolved > turnInvolved) ? GridHitNewRoundResultEnum.Promoted : GridHitNewRoundResultEnum.Enhanced);
            }
            return(GridHitNewRoundResultEnum.None);
        }
示例#3
0
        public MiddleTriRankTexture(RiverBoard board)
        {
            TurnBoard = board.TurnBoard;
            switch (TurnBoard.RankTexture)
            {
            case TurnBoardRankTextureEnum.HighTri:
                var highTriTexture = new Turn.TurnBoardRankTextures.HighTriRankTexture(TurnBoard);
                if (board.River.Rank <= highTriTexture.TriCard1.Rank)
                {
                    throw new InvalidOperationException();
                }
                HighCard = board.River;
                TriCard1 = highTriTexture.TriCard1;
                TriCard2 = highTriTexture.TriCard2;
                TriCard3 = highTriTexture.TriCard3;
                LowCard  = highTriTexture.SingleCard;
                break;

            case TurnBoardRankTextureEnum.LowTri:
                var lowTriTexture = new Turn.TurnBoardRankTextures.LowTriRankTexture(TurnBoard);
                if (board.River.Rank >= lowTriTexture.TriCard1.Rank)
                {
                    throw new InvalidOperationException();
                }
                HighCard = lowTriTexture.SingleCard;
                TriCard1 = lowTriTexture.TriCard1;
                TriCard2 = lowTriTexture.TriCard2;
                TriCard3 = lowTriTexture.TriCard3;
                LowCard  = board.River;
                break;

            case TurnBoardRankTextureEnum.MiddlePair:
                var middlePairTexture = new MiddlePairRankTexture(TurnBoard);
                if (board.River.Rank != middlePairTexture.PairCard1.Rank)
                {
                    throw new InvalidOperationException();
                }
                HighCard = middlePairTexture.HighCard;
                TriCard1 = middlePairTexture.PairCard1;
                TriCard2 = middlePairTexture.PairCard2;
                TriCard3 = board.River;
                LowCard  = middlePairTexture.LowCard;
                break;

            default:
                throw new InvalidOperationException();
            }
        }
示例#4
0
        public FoursomeRankTexture(RiverBoard board)
        {
            TurnBoard = board.TurnBoard;
            switch (TurnBoard.RankTexture)
            {
            case TurnBoardRankTextureEnum.Foursome:
                FoursomeCard1 = TurnBoard.FlopBoard.Flop1;
                FoursomeCard2 = TurnBoard.FlopBoard.Flop2;
                FoursomeCard3 = TurnBoard.FlopBoard.Flop3;
                FoursomeCard4 = TurnBoard.TurnCard;
                SingleCard    = board.River;
                break;

            case TurnBoardRankTextureEnum.HighTri:
                var highTriTexture = new Turn.TurnBoardRankTextures.HighTriRankTexture(TurnBoard);
                FoursomeCard1 = highTriTexture.TriCard1;
                FoursomeCard2 = highTriTexture.TriCard2;
                FoursomeCard3 = highTriTexture.TriCard3;
                if (board.River.Rank != FoursomeCard1.Rank)
                {
                    throw new InvalidOperationException();
                }
                FoursomeCard4 = board.River;
                SingleCard    = highTriTexture.SingleCard;
                break;

            case TurnBoardRankTextureEnum.LowTri:
                var lowTriTexture = new Turn.TurnBoardRankTextures.LowTriRankTexture(TurnBoard);
                FoursomeCard1 = lowTriTexture.TriCard1;
                FoursomeCard2 = lowTriTexture.TriCard2;
                FoursomeCard3 = lowTriTexture.TriCard3;
                if (board.River.Rank != FoursomeCard1.Rank)
                {
                    throw new InvalidOperationException();
                }
                FoursomeCard4 = board.River;
                SingleCard    = lowTriTexture.SingleCard;
                break;

            default:
                throw new InvalidOperationException();
            }
        }
示例#5
0
        public LowTriRankTexture(RiverBoard board)
        {
            TurnBoard = board.TurnBoard;
            switch (TurnBoard.RankTexture)
            {
            case TurnBoardRankTextureEnum.LowTri:
                var lowTriTexture = new Turn.TurnBoardRankTextures.LowTriRankTexture(TurnBoard);
                if (board.River.Rank == lowTriTexture.SingleCard.Rank ||
                    board.River.Rank < lowTriTexture.TriCard1.Rank)
                {
                    throw new InvalidOperationException();
                }
                HighCard = board.River.Rank > lowTriTexture.SingleCard.Rank
                        ? board.River
                        : lowTriTexture.SingleCard;
                MiddleCard = board.River.Rank < lowTriTexture.SingleCard.Rank
                        ? board.River
                        : lowTriTexture.SingleCard;
                TriCard1 = lowTriTexture.TriCard1;
                TriCard2 = lowTriTexture.TriCard2;
                TriCard3 = lowTriTexture.TriCard3;
                break;

            case TurnBoardRankTextureEnum.LowPair:
                var lowPairTexture = new Turn.TurnBoardRankTextures.LowPairRankTexture(TurnBoard);
                if (board.River.Rank != lowPairTexture.PairCard1.Rank)
                {
                    throw new InvalidOperationException();
                }
                HighCard   = lowPairTexture.HighCard;
                MiddleCard = lowPairTexture.MiddleCard;
                TriCard1   = lowPairTexture.PairCard1;
                TriCard2   = lowPairTexture.PairCard2;
                TriCard3   = board.River;
                break;

            default:
                throw new InvalidOperationException();
            }
        }