Hello,
Currently I’m using CoronaPrototype to make classes as follow:
local Prototype = require("CoronaPrototype") local MyClass = Prototype:newClass("MyClass") function MyClass:initialize(params) ... --usage: local obj = MyClass:new({name = "Bob"})
I understand that I could inherit from MyClass in following way:
local SecondClass = MyClass:newClass("Second") function SecondClass:initialize(params)
But I noticed that when I do MyClass:newClass call initialize function from MyClass get called (with nil params)
So should I handle params == nil and skip initialization? (in example above I want to set self.name = params.name, so params should always be passed)
Also documentation for CoronaPrototype is pretty brief. Does anybody using this or some other library for OOP?