Minor annotation on the Object class
This commit is contained in:
@@ -15,13 +15,18 @@
|
|||||||
-- You should have received a copy of the GNU General Public License along with
|
-- You should have received a copy of the GNU General Public License along with
|
||||||
-- Omicron Frames. If not, see <https://www.gnu.org/licenses/>.
|
-- Omicron Frames. If not, see <https://www.gnu.org/licenses/>.
|
||||||
local omi = select(2, ...)
|
local omi = select(2, ...)
|
||||||
|
|
||||||
|
---@class Object
|
||||||
local Object = omi.GetModule("types").Object
|
local Object = omi.GetModule("types").Object
|
||||||
local IsDerivedFrom = omi.GetModule("types").IsDerivedFrom
|
local IsDerivedFrom = omi.GetModule("types").IsDerivedFrom
|
||||||
|
|
||||||
-- Create a new instance of Object or (more likely) any inheriting class
|
-- Create a new instance of Object or (more likely) any inheriting class
|
||||||
function Object.new(class, ...)
|
---@generic T : Object
|
||||||
|
-- @param cls T
|
||||||
|
-- @return T
|
||||||
|
function Object.new(cls, ...)
|
||||||
local o = {}
|
local o = {}
|
||||||
setmetatable(o, class)
|
setmetatable(o, cls)
|
||||||
|
|
||||||
if o.Init ~= nil then
|
if o.Init ~= nil then
|
||||||
o:Init(...)
|
o:Init(...)
|
||||||
|
Reference in New Issue
Block a user