public HighTriLowPairRankTexture(RiverBoard board) { TurnBoard = board.TurnBoard; switch (TurnBoard.RankTexture) { case TurnBoardRankTextureEnum.HighTri: var highTriTexture = new Turn.TurnBoardRankTextures.HighTriRankTexture(TurnBoard); TriCard1 = highTriTexture.TriCard1; TriCard2 = highTriTexture.TriCard2; TriCard3 = highTriTexture.TriCard3; if (highTriTexture.SingleCard.Rank != board.River.Rank) { throw new InvalidOperationException(); } PairCard1 = highTriTexture.SingleCard; PairCard2 = board.River; break; case TurnBoardRankTextureEnum.TwoPairs: var twoPairsTexture = new TwoPairsRankTexture(TurnBoard); if (twoPairsTexture.HighPairCard1.Rank != board.River.Rank) { throw new InvalidOperationException(); } TriCard1 = twoPairsTexture.HighPairCard1; TriCard2 = twoPairsTexture.HighPairCard2; TriCard3 = board.River; PairCard1 = twoPairsTexture.LowPairCard1; PairCard2 = twoPairsTexture.LowPairCard2; break; default: throw new InvalidOperationException(); } }
public GridHitNewRoundResultEnum HitRiver(RangeGrid grid) { RankHandGradeEnum turnGrade; int turnInvolved; switch (TurnBoard.RankTexture) { case TurnBoardRankTextureEnum.HighTri: var highTriTuple = new Turn.TurnBoardRankTextures.HighTriRankTexture(TurnBoard).TestGridAgainstBoard(grid); turnGrade = highTriTuple.Item1.Grade(); turnInvolved = highTriTuple.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); }
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(); } }
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(); } }
public HighTriRankTexture(RiverBoard board) { TurnBoard = board.TurnBoard; switch (TurnBoard.RankTexture) { case TurnBoardRankTextureEnum.HighTri: var highTriTexture = new Turn.TurnBoardRankTextures.HighTriRankTexture(TurnBoard); if (board.River.Rank == highTriTexture.SingleCard.Rank || board.River.Rank == highTriTexture.TriCard1.Rank) { throw new InvalidOperationException(); } TriCard1 = highTriTexture.TriCard1; TriCard2 = highTriTexture.TriCard2; TriCard3 = highTriTexture.TriCard3; MiddleCard = highTriTexture.SingleCard.Rank > board.River.Rank ? highTriTexture.SingleCard : board.River; LowCard = highTriTexture.SingleCard.Rank < board.River.Rank ? highTriTexture.SingleCard : board.River; break; case TurnBoardRankTextureEnum.HighPair: var highPairTexture = new Turn.TurnBoardRankTextures.HighPairRankTexture(TurnBoard); if (board.River.Rank != highPairTexture.PairCard1.Rank) { throw new InvalidOperationException(); } TriCard1 = highPairTexture.PairCard1; TriCard2 = highPairTexture.PairCard2; TriCard3 = board.River; MiddleCard = highPairTexture.MiddleCard; LowCard = highPairTexture.LowCard; break; default: throw new InvalidOperationException(); } }