1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-12 10:04:40 +02:00

Merge pull request #705 from plague006/debug_object_type

Add object_type() to Debug
This commit is contained in:
Matthew 2019-01-28 17:53:55 -05:00 committed by GitHub
commit baba491375
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,6 +68,16 @@ function Debug.print(message, trace_levels)
log(message)
end
--- Returns the factorio LuaObject type or the Lua data type
-- @param object <any>
function Debug.object_type(object)
local obj_type = type(object)
if obj_type == 'table' and object.isluaobject then
return match(object.help(),'Lua%a+')
end
return obj_type
end
---Shows the given message if debug is on.
---@param position Position
---@param message string