/* Every hand history file ends with a sequence of tokens (1 or more) * If we detect the end of a game we raise the appropriate event */ protected virtual void CheckForEndOfRound(String line) { Match matchResult; if (LineMatchesRegex(line, pokerClient.GetRegex("hand_history_detect_end_of_round"))) { // Increment endOfRoundTokensDetected++; // Have we reached the limit? int numberRequired = pokerClient.GetConfigInt("hand_history_end_of_round_number_of_tokens_required"); if (endOfRoundTokensDetected >= numberRequired) { Trace.WriteLine("End of round"); OnRoundHasTerminated(); endOfRoundTokensDetected = 0; } } else if (LineMatchesRegex(line, pokerClient.GetRegex("hand_history_detect_hero_name"), out matchResult)) { String heroName = matchResult.Groups["heroName"].Value; OnHeroNameFound(heroName); Trace.WriteLine("Found hero's name: " + heroName); } }
public UniversalHHParser(PokerClient pokerClient, String handhistoryFilename) : base(pokerClient, handhistoryFilename) { reGameType = pokerClient.GetRegex("hand_history_game_token"); }