Remove GlobalSpace, domains and extends methods in Mod

This commit is contained in:
Van
2025-12-01 17:08:56 +03:00
parent ace217832b
commit e44420d0ab
19 changed files with 72 additions and 50 deletions

View File

@@ -1,5 +1,5 @@
Api = {}
--[[
---@alias Domain table<string,Mod|SubDomain> Global table for accessing public classes provided by mods.
---@alias SubDomain table<string,Mod>
@@ -46,7 +46,7 @@ Api.addModToGlobalSpace = function(mod, location, force)
-- TODO: баг: ликвидные имена не определяются шаблоном
--[[if not location:match('^[%a_][%w_]*([%.][%a_][%w_]*)*$') then
error('bad argument #2 to \'Api.addModToGlobalSpace\' (invalid format)')
end--]]
end --] ]
-- Split `location` into fields -- TODO: !!!Make a String function!!!
local fields = {}
@@ -88,4 +88,4 @@ Api.addModToGlobalSpace = function(mod, location, force)
error(string.format('field \'%s\' already exists in \'%s\'', last_field, location))
end
current[last_field] = mod
end
end --]]

View File

@@ -28,6 +28,7 @@ function Mod.getInfo(modname)
return {name = name, shortName = shortName, path = path, require = require}
end
--[[
function Mod:new()
---@type Mod
local instance = setmetatable(Mod.getInfo(), { __index = self })
@@ -61,6 +62,6 @@ function Mod:getModClassExtended(ChildClass)
local childClass = Mod:getClassExtended(self.Class, ChildClass or {})
return childClass
end
end --]]
return Mod