Type Checkers - MSUTeam/MSU GitHub Wiki
File path: scripts/config/msu/type_checkers.nut
::MSU.requireXYZ( ... )
// ... is any number of any variable type
Does nothing if all passed arguments are of type XYZ.
Throws a ::MSU.Exception.InvalidType
if they are not.
::MSU.requireString( ... ) // string
::MSU.requireInt( ... ) // integer
::MSU.requireArray( ... ) // array
::MSU.requireFloat( ... ) // float
::MSU.requireBool( ... ) // boolean
::MSU.requireTable( ... ) // table
::MSU.requireInstance( ... ) // instance
::MSU.requireInstanceOf( _class, ... ) // instance of _class
::MSU.requireFunction( ... ) // function
::MSU.requireType( _type, ... ) // _type
::MSU.requireOneFromTypes( _typeArray, ... )
// _typeArray is an array
// ... is any number of any variable type
Does nothing if all variables passed in ...
are any one of the types in _typeArray
.
Throws ::MSU.Exception.InvalidType
if they are not.
::MSU.requireAnyTypeExcept( _typeArray, ... )
// _typeArray is an array,
// ... is any number of any variable type
Does nothing if all variables passed in ...
are not any of the types in _typeArray
.
Throws ::MSU.Exception.InvalidType
if they are.