Add DataDictionary.TryGetValue IsNumber Variant
BobyStar
Request to add a variant of DataDictionary.TryGetValue that returns true if the value token, if found, is a Number.
DataDictionary TryGetValue does not have support for checking if the value is a Number (any numeric value type). Unlike other TokenTypes which can be included as a part of the check, currently you have to run the TryGetValue without a type check and then check the resulting DataToken.IsNumber value to know for certain the type is expected. This becomes tedious when reading values deserialized from VRCJson which recommends using the DataToken.Number value over any specific numeric type.
Example Workflow:
VRCJson Deserialize > Check If DataDictionary > DataDicionary TryGetValue > Check If Returned Token IsNumber > Get Number and optionally cast to desired type.
With the TryGetValue IsNumber Variant:
VRCJson Deserialize > Check If DataDictionary > DataDicionary TryGetValue IsNumber > Get Number and optionally cast to desired type.
Log In