Fix my bruh

This commit is contained in:
Van
2025-08-30 14:54:59 +00:00
parent 1067e3ceb8
commit f22a85fc4a
6 changed files with 22 additions and 20 deletions

View File

@@ -33,17 +33,30 @@ end
---@return table
-- TODO: возможно стоит создать какой-то абстрактный класс,
-- который будет является алеасом на table и будет обозначать наш класс
function Mod:getClassInstance()
function Mod:getModClassInstance()
local instance = self.Class:new()
return instance
end
--- Inherit from a class provided by the mod
---@param ChildClass table?
--- Inherits a child class from a parent class
---@static
---@param ParentClass table
---@param ChildClass table?
---@return table
function Mod:getClassExtended(ChildClass)
ChildClass = Api.getClassExtended(self.Class, ChildClass or {})
function Mod:getClassExtended(ParentClass, ChildClass)
local ChildClass = setmetatable(ChildClass or {}, { __index = ParentClass })
return ChildClass
end
end
--- Inherits a child class from a parent public class provided by the mod.
---@static
---@param ChildClass table?
---@return table
function Mod:getModClassExtended(ChildClass)
local ChildClass = Mod:getClassExtended(self.Class, ChildClass or {})
return ChildClass
end