Compare commits

...

2 commits

Author SHA1 Message Date
Simon Brodtmann
6de1a8f1c7 Add Recipe:addCategory 2025-12-12 18:36:25 +01:00
Simon Brodtmann
a6f495af8b Add Item:defaultImportLocation 2025-12-12 18:36:15 +01:00
2 changed files with 18 additions and 0 deletions

View file

@ -57,4 +57,11 @@ function Item:itemsPerRocket(count)
return self
end
--- Sets the default import location for space platforms
--- @param planetName string The name of the planet
function Item:defaultImportLocation(planetName)
self.prototype.default_import_location = planetName
return self
end
return Item

View file

@ -187,6 +187,17 @@ function Recipe:removeResult(resultName)
return self
end
--- Adds an additional crafting category
--- @param categoryName string The name of the crafting category
function Recipe:addCategory(categoryName)
local categories = self.prototype.additional_categories or {}
self.prototype.additional_categories = categories
if not table.contains(categories, categoryName) then
table.insert(categories, categoryName)
end
return self
end
--- Adds the recipe to a technology
--- @param technology string|table The name of the technology or the technology table
function Recipe:unlockedByTechnology(technology)