private bool ValueMatches()

in Scripts/Runtime/CallbackHandlers/WitResponseMatcher.cs [84:114]


        private bool ValueMatches(WitResponseNode response)
        {
            bool matches = true;
            for (int i = 0; i < valueMatchers.Length && matches; i++)
            {
                var matcher = valueMatchers[i];
                var value = matcher.Reference.GetStringValue(response);
                matches &= !matcher.contentRequired || !string.IsNullOrEmpty(value);

                switch (matcher.matchMethod)
                {
                    case MatchMethod.RegularExpression:
                        matches &= Regex.Match(value, matcher.matchValue).Success;
                        break;
                    case MatchMethod.Text:
                        matches &= value == matcher.matchValue;
                        break;
                    case MatchMethod.IntegerComparison:
                        matches &= CompareInt(value, matcher);
                        break;
                    case MatchMethod.FloatComparison:
                        matches &= CompareFloat(value, matcher);
                        break;
                    case MatchMethod.DoubleComparison:
                        matches &= CompareDouble(value, matcher);
                        break;
                }
            }

            return matches;
        }