So i've been looking into meta tables, but i feel like use it would create more unnecessary code...
...unless i'm looking at it wrong.
So in the example i'm showing i'm wandering if i'm using it correctly.
can someone give a brief run down on why you need -or- should use metatables
Lua Code:
local SomeClass = {}
metatable = {}
setmetatable(SomeClass, metatable)
function SomeClass:DoSomething ( table, ... )
return "Something Happens"
end
function metatable:__call( table, ... )
return SomeClass:DoSomething(table, ... )
end
this being like this, i can just print(SomeClass()) and it would result in "Something Happens" ... buut I fell like itd be simplier to just do a static call print(SomeClass: DoSomething()) ... Space in ther to prevent emoticon and static may be the wrong term (php dev background)