Compare commits
2 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
8ded39211b | ||
![]() |
9878331df5 |
5 changed files with 31 additions and 2 deletions
|
@ -1,4 +1,9 @@
|
||||||
---------------------------------------------------------------------------------------------------
|
---------------------------------------------------------------------------------------------------
|
||||||
|
Version: 0.0.14
|
||||||
|
Date: 10.06.2025
|
||||||
|
Changes:
|
||||||
|
Add :merge
|
||||||
|
---------------------------------------------------------------------------------------------------
|
||||||
Version: 0.0.13
|
Version: 0.0.13
|
||||||
Date: 23.05.2025
|
Date: 23.05.2025
|
||||||
Changes:
|
Changes:
|
||||||
|
|
|
@ -42,6 +42,14 @@ function Item:assign(data)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Deeply merges data with the item
|
||||||
|
--- Shorthand for table.merge(item.prototype, data)
|
||||||
|
--- @param data table The data to merge
|
||||||
|
function Item:merge(data)
|
||||||
|
table.merge(self.prototype, data)
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Sets the weight of the item calculated from given count per rocket.
|
--- Sets the weight of the item calculated from given count per rocket.
|
||||||
--- @param count number The amount of items that fit into a rocket
|
--- @param count number The amount of items that fit into a rocket
|
||||||
function Item:itemsPerRocket(count)
|
function Item:itemsPerRocket(count)
|
||||||
|
|
|
@ -42,6 +42,14 @@ function Recipe:assign(data)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Deeply merges data with the recipe
|
||||||
|
--- Shorthand for table.merge(recipe.prototype, data)
|
||||||
|
--- @param data table The data to merge
|
||||||
|
function Recipe:merge(data)
|
||||||
|
table.merge(self.prototype, data)
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Adds an ingredient to the recipe
|
--- Adds an ingredient to the recipe
|
||||||
--- @param ingredientName string The name of the ingredient
|
--- @param ingredientName string The name of the ingredient
|
||||||
--- @param amount number The amount of the ingredient (default: 1)
|
--- @param amount number The amount of the ingredient (default: 1)
|
||||||
|
@ -62,7 +70,7 @@ function Recipe:addIngredient(ingredientName, amount)
|
||||||
ingredient.amount_min = nil
|
ingredient.amount_min = nil
|
||||||
ingredient.amount_max = nil
|
ingredient.amount_max = nil
|
||||||
ingredient.probability = nil
|
ingredient.probability = nil
|
||||||
return
|
return self
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
table.insert(self.prototype.ingredients, { name = ingredientName, amount = amount, type = ingredientType })
|
table.insert(self.prototype.ingredients, { name = ingredientName, amount = amount, type = ingredientType })
|
||||||
|
|
|
@ -50,6 +50,14 @@ function Technology:assign(data)
|
||||||
return self
|
return self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--- Deeply merges data with the technology
|
||||||
|
--- Shorthand for table.merge(technology.prototype, data)
|
||||||
|
--- @param data table The data to merge
|
||||||
|
function Technology:merge(data)
|
||||||
|
table.merge(self.prototype, data)
|
||||||
|
return self
|
||||||
|
end
|
||||||
|
|
||||||
--- Sets the prerequisite for the technology
|
--- Sets the prerequisite for the technology
|
||||||
--- @param prerequisites table The names of the prerequisites
|
--- @param prerequisites table The names of the prerequisites
|
||||||
function Technology:setPrerequisites(prerequisites)
|
function Technology:setPrerequisites(prerequisites)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "cf-lib",
|
"name": "cf-lib",
|
||||||
"version": "0.0.13",
|
"version": "0.0.14",
|
||||||
"title": "cackling fiends library",
|
"title": "cackling fiends library",
|
||||||
"description": "Because I'd like to have my own library :-)",
|
"description": "Because I'd like to have my own library :-)",
|
||||||
"author": "cackling fiend",
|
"author": "cackling fiend",
|
||||||
|
|
Loading…
Add table
Reference in a new issue