PokerMuck.PokerClient.GetConfigInt C# (CSharp) Method

GetConfigInt() public method

public GetConfigInt ( String key ) : int
key String
return int
        public int GetConfigInt(String key)
        {
            return (int)GetConfig(key);
        }

Usage Example

示例#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);
            }
        }