| Code: |
// For: GetIsAType()
CONST ISA_GET_MAIN := 0x0; // Default
CONST ISA_GET_ALL := 0x1;
|
| Code: |
/*
* GetIsAType(object, flags)
*
* Purpose
* Retrieves the 'IsA' type for an object or all of the
* classes it belongs to.
*
* Parameters:
* object: Anything belonging to the UObject class heirarchy.
* flags: Flags...
*
* Return value:
* Returns an error on failure.
* Returns an integer if ISA_GET_MAIN is passed for flags.
* Returns an array of integers if ISA_GET_ALL is used.
*
*/
function GetIsAType(object, flags:=ISA_GET_MAIN)
var type_list := array;
var i := 16; // Max number of IsA Id #s
for ( i; i > 0; i-=1 )
if ( !object.IsA(i) )
continue;
elseif ( flags & ISA_GET_ALL )
type_list.Append(i);
else
return i;
endif
SleepMS(2);
endfor
if ( type_list.Size() > 0 )
return type_list;
else
return error{"errortext":="Unable to determine IsA type of '"+TypeOf(object)+"'"};
endif
endfunction
|