From c36fd418abadc389ce2808a8b5ecdedd127783e8 Mon Sep 17 00:00:00 2001 From: Simon Brodtmann Date: Fri, 28 Mar 2025 18:54:28 +0100 Subject: [PATCH] Add Technology:setIngredients --- cf-lib/data/Technology.lua | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cf-lib/data/Technology.lua b/cf-lib/data/Technology.lua index f30d739..bf950c8 100644 --- a/cf-lib/data/Technology.lua +++ b/cf-lib/data/Technology.lua @@ -140,6 +140,15 @@ function Technology:removeIngredient(ingredientName) return self end +--- Sets the ingredients for the technology +--- @param ingredientNames table The names of the ingredients +function Technology:setIngredients(ingredients) + self.prototype.unit = self.prototype.unit or {} + self.prototype.unit.ingredients = {} + self:addIngredients(ingredients) + return self +end + --- Adds a recipe unlock to the technology --- @param recipeName string The name of the recipe to unlock function Technology:addRecipe(recipeName)