#84 improved element creation process for adding children

This commit is contained in:
Mikayla Fischler
2022-07-28 10:09:34 -04:00
parent 01a364b5cf
commit f1a50990f2
18 changed files with 90 additions and 54 deletions

View File

@@ -6,14 +6,16 @@ local core = require("graphics.core")
local element = require("graphics.element")
---@class pipenet_args
---@field parent graphics_element
---@field x? integer 1 if omitted
---@field y? integer 1 if omitted
---@field pipes table pipe list
---@field bg? color background color
---@field parent graphics_element
---@field id? string element id
---@field x? integer 1 if omitted
---@field y? integer 1 if omitted
-- new pipe network
---@param args pipenet_args
---@return graphics_element element, element_id id
local function pipenet(args)
assert(type(args.pipes) == "table", "graphics.elements.indicators.pipenet: pipes is a required field")
@@ -139,7 +141,7 @@ local function pipenet(args)
end
return e.get()
return e.complete()
end
return pipenet