Exemplo n.º 1
0
 public OpponentData(string playerName)
 {
     PlayerName      = playerName;
     Wins            = 0;
     Losses          = 0;
     BigBlindHands   = new HandData();
     SmallBlindHands = new HandData();
 }
Exemplo n.º 2
0
        private HandData UpdateHandData(HandData currentData, Hand hand)
        {
            HandData result = currentData;

            result.Hands++;
            for (int roundNumber = 0; roundNumber < hand.Rounds.Count; roundNumber++)
            {
                int i = hand.Players[0].IsBigBlind ? 1 : 0;
                for (; i < hand.Rounds[roundNumber].Turns.Count; i++)
                {
                    switch (hand.Rounds[roundNumber].Turns[i].Action)
                    {
                    case PlayerAction.Call:
                        currentData.Calls[roundNumber]++;
                        break;

                    case PlayerAction.Check:
                        currentData.Checks[roundNumber]++;
                        break;

                    case PlayerAction.Fold:
                        currentData.Folds[roundNumber]++;
                        break;

                    case PlayerAction.Raise:
                        if (IsReRaise(hand.Rounds[roundNumber].Turns, i))
                        {
                            currentData.ReRaises[roundNumber]++;
                        }
                        else
                        {
                            currentData.Raises[roundNumber]++;
                        }
                        break;

                    default:
                        throw new Exception("An illegal playerAction has been made in round " + roundNumber + ".");
                    }
                }
            }

            return(result);
        }