I have a codepath where I receive a vector of parameters from client code, intended for passing as parameters to a script-function call. In debug mode, I'd like to do some sanity checking on these parameters (like making sure that the number of values matches the number of parameters the script-function expects).
I currently have the following code (for each param):
if ( (funcParamTypeId & asTYPEID_SCRIPTOBJECT) )
{
// no way to pass a script object from C++ to a script function call.. this is an error condition
}
else if ( (funcParamTypeId & asTYPEID_MASK_OBJECT) )
{
// check whether script-function param is a known application-registered type such as 'string' or 'Vector2' and ensure that that's what we got
}
else if ( (funcParamTypeId & asTYPEID_MASK_SEQNBR) )
{
// check whether script-function param is a script primitive type
}
I realize based on the GC comment here that this is an incorrect use of asTYPEID_MASK_SEQNBR and it's just happening to work. (I don't have a lot of experience with GC yet because all my application-registered types are the NOCOUNT variety so far... the 'number' portion of the name confused me at the time.)
Is the proper way to rewrite that condition:
else if ( funcParamTypeId >= asTYPEID_BOOL && funcParamTypeId <= asTYPEID_DOUBLE )
?
Thank you very much.