Reorganize project into folder structure

This commit is contained in:
JonShard
2026-07-16 15:09:12 +02:00
parent 4b8e017d64
commit e27ddfe3f1
33 changed files with 156 additions and 70 deletions
+24
View File
@@ -0,0 +1,24 @@
class_name CombinableItem
extends Node
## Identity of this item, referenced by other items' recipes.
@export var id: StringName
## Recipes describing what the item holding this component turns into when
## another item is combined into it while snapped. Recipes are directional:
## only the snapped (base) item's recipes are consulted.
@export var recipes: Array[CombineRecipe] = []
func _ready() -> void:
if id.is_empty():
push_error("CombinableItem on ", get_parent().name, " has no 'id' set.")
## Returns the scene this item becomes when combined with [param other_id],
## or null if there is no matching recipe.
func get_result_for(other_id: StringName) -> PackedScene:
for recipe in recipes:
if recipe and recipe.ingredient_id == other_id:
return recipe.result
return null