This commit is contained in:
Van
2025-08-30 15:26:49 +00:00
parent f22a85fc4a
commit b25219b947
5 changed files with 15 additions and 29 deletions

View File

@@ -4,16 +4,11 @@
---@field public path string Path to the mod folder. ---@field public path string Path to the mod folder.
---@field public Class table A public class that provides a mod. ---@field public Class table A public class that provides a mod.
---@field public require fun(FileName:string) ---@field public require fun(FileName:string)
Mod = { Mod = {}
name = nil,
path = nil,
require = nil,
Class = nil,
}
--- Return table with mod name, path and require function. --- Return table with mod name, path and require function.
---@return {name: string, path: string, require: fun(FileName : string)} ---@return {name: string, path: string, require: fun(FileName : string): table}
function Mod.getInfo() function Mod.getInfo()
local name = core.get_current_modname() local name = core.get_current_modname()
local path = core.get_modpath(name) local path = core.get_modpath(name)

View File

@@ -1,10 +1,7 @@
---@class Item ---@class Item
---@field itemDef Item.ItemDefinition ---@field itemDef Item.ItemDefinition
---@field luantiDef table ---@field luantiDef table
local Item = { local Item = {}
itemDef = nil,
luantiDef = nil,
}
---@param itemDef Item.ItemDefinition ---@param itemDef Item.ItemDefinition
local function itemDefToLuantiDef(itemDef) local function itemDefToLuantiDef(itemDef)
@@ -38,7 +35,9 @@ end
---@param itemDef Item.ItemDefinition ---@param itemDef Item.ItemDefinition
---@return Item ---@return Item
function Item:new(itemDef) function Item:new(itemDef)
local instance = {} ---@type Item
local instance = setmetatable({}, {__index = self})
local luantiDef = itemDefToLuantiDef(itemDef) local luantiDef = itemDefToLuantiDef(itemDef)
local visual = itemDef.settings.visual local visual = itemDef.settings.visual
itemDef.settings.visual = nil itemDef.settings.visual = nil

View File

@@ -21,16 +21,7 @@ local Region3D = require("MapGen.Region.Region3D")
---@field layersList table ---@field layersList table
---@field registeredRegions table ---@field registeredRegions table
---@field material table<string, number> ---@field material table<string, number>
local MapGen = { local MapGen = {}
layersByName = nil,
layersList = nil,
registeredRegions = nil,
materials = {
impassableWater = nil,
impassableSeabed = nil,
air = nil,
},
}
---@return MapGen ---@return MapGen
function MapGen:new() function MapGen:new()

View File

@@ -6,13 +6,7 @@ local table, setmetatable = table, setmetatable
---@field maxY number ---@field maxY number
---@field regions2D MapGen.Region.Region2D[] ---@field regions2D MapGen.Region.Region2D[]
---@field regions3D MapGen.Region.Region3D[] ---@field regions3D MapGen.Region.Region3D[]
local Layer = { local Layer = {}
name = nil,
minY = nil,
maxY = nil,
regions2D = nil,
regions3D = nil,
}
---@return MapGen.Layer ---@return MapGen.Layer
---@param name string ---@param name string

View File

@@ -3,8 +3,15 @@ local Node = Core.Item:getModClassExtended({
--TODO: Че тут писать? --TODO: Че тут писать?
}) })
---@return Node
function Node:new() function Node:new()
---@type Node
local instance
--TODO: Это надо вообще? --TODO: Это надо вообще?
return instance
end end
return Node return Node