public void Train(int numberOfHands) { for (int i = 0; i < numberOfHands; i++) { dealer.DealHoleCards(players); // deal board at the beginning of each hand already for training var board = new List <Card>(); dealer.DealFlop(board); dealer.DealTurn(board); dealer.DealRiver(board); StartHandBucket startHandBucket1 = StartHandAbstracter.MapToBucket(dummyPlayer1.HoleCards[0], dummyPlayer1.HoleCards[1]); StartHandBucket startHandBucket2 = StartHandAbstracter.MapToBucket(dummyPlayer2.HoleCards[0], dummyPlayer2.HoleCards[1]); var handBuckets = new List <byte>() { (byte)startHandBucket1, (byte)startHandBucket2 }.ToArray(); var initialState = new HeadsUpGameState() { Phase = GamePhase.PreFlop, Board = board, Player1HoleCards = dummyPlayer1.HoleCards, Player2HoleCards = dummyPlayer2.HoleCards, PotSize = HeadsupGame.BigBlindSize + HeadsupGame.SmallBlindSize, AmountToCall = HeadsupGame.SmallBlindSize }; CalculateCounterFactualRegret(initialState, handBuckets, new List <ActionBucket>(), 1, 1); } }
public void StartNewRound(PlayedHandEntity result) { initializeValues(); moveBlinds(); foreach (var player in players) { PotSize += player.GetBlind(); } dealer.DealHoleCards(players); result.HoleCards1 = players[0].HoleCards.ToAbbreviations(); result.HoleCards2 = players[1].HoleCards.ToAbbreviations(); }