GetRegex() 공개 메소드

public GetRegex ( String key ) : Regex
key String
리턴 System.Text.RegularExpressions.Regex
예제 #1
0
        /* 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);
            }
        }
예제 #2
0
 public UniversalHHParser(PokerClient pokerClient, String handhistoryFilename)
     : base(pokerClient, handhistoryFilename)
 {
     reGameType = pokerClient.GetRegex("hand_history_game_token");
 }
예제 #3
0
 public UniversalHHParser(PokerClient pokerClient, String handhistoryFilename)
     : base(pokerClient, handhistoryFilename)
 {
     reGameType = pokerClient.GetRegex("hand_history_game_token");
 }