Pop.Box/util.lua

20 lines
429 B
Lua
Raw Normal View History

2016-06-21 19:32:58 +00:00
local inheritsFromElement
inheritsFromElement = function(object)
if object and type(object) == "table" and object.__class then
2016-06-21 19:32:58 +00:00
local cls = object.__class
if cls.__name == "element" then
return true
end
while cls.__parent do
cls = cls.__parent
if cls.__name == "element" then
return true
end
end
end
return false
end
return {
inheritsFromElement = inheritsFromElement
}