sorcery  craft.lua at [01f4ba8ddc]

File craft.lua artifact 89692ab6f4 part of check-in 01f4ba8ddc


-- general improvements to and abstractions over crafting system
sorcery.craft = {}

-- TODO: extend crafting system prediction &c functions for liquid mixing
-- (this will be a huge amount of work)
local newgrid = function(w,h,zero) 
	local grid = {}
	if zero ~= nil then zero = {} end
	for y=1,h do
		grid[y] = {}
		for x=1,w do grid[y][x] = zero end
	end
end
local dimgrid = function(grid)
	local w = 0
	for i=1,#grid do
		w = math.max(#(grid[i]), w)
	end
	return w, #grid
end
sorcery.craft.register_ingredient_class = function(cl)

end
sorcery.craft.recipes_static = {}
sorcery.craft.recipes_dynamic = {}

sorcery.craft.register_simple = function(spec)
	-- handles only static classes, uses the builtin crafting registry

end

sorcery.craft.register = function(spec)
	-- handles dynamic classes as wel
end