In the package runtime, type & TypeID is replaced by gpm.type & gpm.TypeID so there is no need to replace it manually.
Repeated execution of a function with the same type name will replace the previous function, but the unique type id will be preserved.
Example Usage
local meta = {}
function CreateExampleObject()
local userdata = newproxy()
debug.setmetatable( userdata, meta )
return userdata
end
function IsExampleObject( any )
return debug.getmetatable( any ) == meta
end
local id = gpm.AddType( "ExampleObject", IsExampleObject )
local obj = CreateExampleObject()
print( "result:", obj, IsExampleObject( obj ), gpm.type( obj ), gpm.TypeID( obj ) == id, id )
-- result: userdata: 0xf7ffd962 true ExampleObject true 7