-
Is there a way I can test for an annotated class? I 99% sure the answer is "no" and goes well beyond the capabilities of a Lua interpreter, but I thought I'd ask anyway.
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
The best you can do is probably through metatables: --- This is your "Class"
local Target = {
active = false
}
local myTarget = {
name = "Target1"
}
setmetatable(myTarget, Target)
if getmetatable(myTarget) == Target then
print("myTarget is child of Target class")
end |
Beta Was this translation helpful? Give feedback.
-
I've considered that possibility. The problem is I don't own all the data. As I mentioned in another discussion, the game engine returns everything as |
Beta Was this translation helpful? Give feedback.
-
As suspected, the answer is "no". Or, at least "no" withing the confines of my working environment. Thanks for the feedback. |
Beta Was this translation helpful? Give feedback.
As suspected, the answer is "no". Or, at least "no" withing the confines of my working environment. Thanks for the feedback.