// Create in Unity Editor or via script
var countExtractor = ScriptableObject.CreateInstance<WitIntValue>();
countExtractor.path = "entities.number[0].value";
// Extract int value from response
var response = WitResponseNode.Parse("{\"entities\":{\"number\":[{\"value\":42}]}}");
int count = countExtractor.GetIntValue(response);
// Compare values
bool isFortyTwo = countExtractor.Equals(response, 42); // true
bool fromString = countExtractor.Equals(response, "42"); // also true (parsed)Equals
(
response
, value
)
|
Compares the integer value in the response with a target value. Supports comparing with int values or parsable strings.
Signature
override bool Meta.WitAi.Data.WitIntValue.Equals(WitResponseNode response, object value) Parameters value: object
The value to compare (can be int or parsable string)
Returns override bool
True if values are equal
|
GetIntValue
(
response
)
|
Extracts the integer value from the response at the configured path.
Signature
int Meta.WitAi.Data.WitIntValue.GetIntValue(WitResponseNode response) Parameters Returns int
The extracted integer value
|
GetValue
(
response
)
|
Extracts the integer value from the response at the configured path.
Signature
override object Meta.WitAi.Data.WitIntValue.GetValue(WitResponseNode response) Parameters Returns override object
The extracted integer value as an object
|