public override void EndRound(EndRoundContext context) { var opponentMoves = context.RoundActions.Where(x => x.PlayerName != this.Name); foreach (var oponentAction in opponentMoves) { this.opponentActions.Add((int)oponentAction.Action.Type); } base.EndRound(context); }
public virtual void EndRound(EndRoundContext context) { }
public override void EndRound(EndRoundContext context) { ExecuteWithTimeLimit(TimeSpan.FromMilliseconds(50), () => base.EndRound(context)); }
private void PlayRound(GameRoundType gameRoundType, int communityCardsCount) { for (var i = 0; i < communityCardsCount; i++) { this.communityCards.Add(this.deck.GetNextCard()); } foreach (var player in this.players) { var startRoundContext = new StartRoundContext( gameRoundType, this.communityCards.AsReadOnly(), player.PlayerMoney.Money, this.bettingLogic.Pot); player.StartRound(startRoundContext); } this.bettingLogic.Bet(gameRoundType); foreach (var player in this.players) { var endRoundContext = new EndRoundContext(this.bettingLogic.RoundBets); player.EndRound(endRoundContext); } }
/// <summary> /// Method used at the end of each round. /// </summary> /// <param name="context">The current context of the game.</param> public override void EndRound(EndRoundContext context) { base.EndRound(context); }
public override void EndRound(EndRoundContext context) { var enemyActions = context.RoundActions.Where(a => a.PlayerName == enemyName).ToList(); if (enemyActions.Count > 1) { var enemyLastAction = enemyActions[enemyActions.Count - 1].Action; if (enemyLastAction == PlayerAction.Fold()) { enemyAlwaysRise = false; enemyAlwaysAllIn = false; enemyAlwaysCall = false; return; } previousRoundLastEnemyAction = enemyLastAction; if (currentRoundType == GameRoundType.PreFlop && !(enemyAlwaysAllIn || enemyAlwaysCall || enemyAlwaysRise)) { var enemyFirstPreFlopAction = enemyActions[1].Action; if (enemyFirstPreFlopAction.Type == PlayerActionType.Raise) { enemyRising = true; } else { enemyRising = false; } enemyCardsPrediction = EnemyPredictions.PredictEnemyCardsPreFlop( this.FirstCard, this.SecondCard, enemyFirstPreFlopAction); } } }
public override void EndRound(EndRoundContext context) { this.ourCompleteHand = PokerHands.Nothing; }