forked from Apancore.Studio/simple-makes-complex
ItemFactory: change params for registerNodesByShortDef: remove titile & description params
This commit is contained in:
@@ -22,7 +22,7 @@ local defMerge = function(...)
|
||||
return table.merge(...)
|
||||
end
|
||||
|
||||
---@param itemDefs Item.ItemDefinition[]|Node.NodeDefinition[] List of nodes with parameters unique to them.
|
||||
---@param itemDefs Item.ItemDefinition[]|Node.NodeDefinition[] List of nodes with parameters unique to them.
|
||||
function ItemFactory:registerItems(itemDefs)
|
||||
---@param nodeDef Item.ItemDefinition | Node.NodeDefinition
|
||||
for _, itemDef in ipairs(itemDefs) do
|
||||
@@ -39,16 +39,14 @@ local defMerge = function(...)
|
||||
return table.merge(...)
|
||||
end
|
||||
|
||||
---@param shortNodeDefs table Table of the form `{ {name, title, description, tiles}, {name, title, description, tiles}, ...}`
|
||||
---@param shortNodeDefs [string, (string[]|TileDefinition[])?][] Format list {{name, tiles}, {name, tiles}, ...}
|
||||
function ItemFactory:registerNodesByShortDef(shortNodeDefs)
|
||||
for _, shortNodeDef in ipairs(shortNodeDefs) do
|
||||
---@type Node.NodeDefinition
|
||||
local nodeDef = {
|
||||
settings = {
|
||||
name = shortNodeDef[1],
|
||||
title = shortNodeDef[2],
|
||||
description = shortNodeDef[3],
|
||||
tiles = shortNodeDef[4]
|
||||
name = shortNodeDef[1],
|
||||
tiles = shortNodeDef[2]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -25,14 +25,14 @@ local rockFactory = defaultRock:getFactory()
|
||||
local ts = TileSheet:new("rocks_sheet.png", 16, 16)
|
||||
|
||||
rockFactory:registerNodesByShortDef({
|
||||
{"sylite", "Sylite", nil, {ts:t(0, 0)}},
|
||||
{"tauitite", "Tauitite", nil, {ts:t(0, 2)}},
|
||||
{"iyellite", "Iyellite", nil, {ts:t(0, 4)}},
|
||||
{"falmyte", "Falmyte", nil, {ts:t(0, 6)}},
|
||||
{"hapcoryte", "Hapcoryte", nil, {ts:t(0, 8)}},
|
||||
{"burcite", "Burcite", nil, {ts:t(0, 10)}},
|
||||
{"felhor", "Felhor", nil, {ts:t(0, 12)}},
|
||||
{"malachite", "malachite", nil, {ts:t(0, 14)}}
|
||||
{"sylite", {ts:t(0, 0)}},
|
||||
{"tauitite", {ts:t(0, 2)}},
|
||||
{"iyellite", {ts:t(0, 4)}},
|
||||
{"falmyte", {ts:t(0, 6)}},
|
||||
{"hapcoryte", {ts:t(0, 8)}},
|
||||
{"burcite", {ts:t(0, 10)}},
|
||||
{"felhor", {ts:t(0, 12)}},
|
||||
{"malachite", {ts:t(0, 14)}}
|
||||
})
|
||||
|
||||
--[[
|
||||
|
||||
Reference in New Issue
Block a user