It looks like you're new here. If you want to get involved, click one of these buttons!
I tried something like:
WorldObj = class(obj, ...)
function WorldObj:init()
for o=1, #vargs do
if not vargs[objName] then
self.objs[vargs[objName]] = vargs[obj]
end
end
end
-- however, I can't figure it out.
-- inheritance is not a problem figuring out. But not everything "is-a" object. What of "has-a" or "contains-a" object classes?
Comments
I'm not sure what you're trying to do exactly, but Ill try to help anyway. Are you trying to store a class within a class? This is fairly easy. Here's an example:
(I haven't used classes in a while, so my bad if it doesn't work properly)
My other guess is that you're trying to store a table in a class or something. Here's another example:
Sorry if I hadn't helped you.
Edit: I have changed a bit of the top code.