From 8a54d3c48ff4697b25c70857121bcaaf8e460483 Mon Sep 17 00:00:00 2001 From: Vanic Date: Sat, 30 Aug 2025 13:06:23 +0000 Subject: [PATCH] Add Api.getClassExtended --- mods/API/System/init.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mods/API/System/init.lua b/mods/API/System/init.lua index e7472e3..8d82e63 100644 --- a/mods/API/System/init.lua +++ b/mods/API/System/init.lua @@ -30,6 +30,17 @@ local allowedDomains = { Ui = true } + +--- Inherits a child class from a parent class +---@param ParentClass table +---@param ChildClass table? +---@return table +Api.getClassExtended = function(ParentClass, ChildClass) + local ChildClass = setmetatable(ChildClass or {}, { __index = ParentClass }) + + return ChildClass +end + --- Adds a mod to the global space under specified domain structure ---@param mod Mod The mod table containing functionality to expose ---@param location string Dot-separated path within domain structure (e.g. "Items.Log")