示例#1
0
 private void HandleRiver()
 {
     try
     {
         GameState = PokerGameState.River;
         ClearOutsEvent?.Invoke();
         PokerScore = PokerEvaluator.CalculateRiverScore(CurrentRound.AllCards.Values.ToList().GetRange(0, 7));
         PokerOutsCalculator.CalculateFinalWinChance(CurrentRound.AllCards.Values.ToList());
         UpdateCurrentScoreEvent?.Invoke(PokerScore);
         UpdateBestPossibleEvent?.Invoke(Pokerscore.None);
         UpdateBestChanceEvent?.Invoke(_noOuts);
         UpdateOutsToBestEvent?.Invoke(_noOuts);
     }
     catch (Exception e)
     {
         Log.Error(e.Message);
         Log.Error(e.StackTrace);
     }
 }
示例#2
0
 private void HandleTurn()
 {
     try
     {
         GameState = PokerGameState.Turn;
         ClearOutsEvent?.Invoke();
         PokerScore = PokerEvaluator.CalculateTurnScore(CurrentRound.AllCards.Values.ToList().GetRange(0, 6));
         Outs       = PokerOutsCalculator.CalculateRiverOuts(
             new SixCardHand(CurrentRound.AllCards.Values.ToList().GetRange(0, 6)), PokerScore);
         UpdateOutsEvent?.Invoke(Outs);
         UpdateCurrentScoreEvent?.Invoke(PokerScore);
         UpdateBestPossibleEvent?.Invoke(Outs.BestScore());
         UpdateBestChanceEvent?.Invoke(Outs.BestPossible());
         UpdateOutsToBestEvent?.Invoke(Outs.BestPossible());
     }
     catch (Exception e)
     {
         Log.Error(e.Message);
         Log.Error(e.StackTrace);
     }
 }