# Hurry Curry! - a game about cooking # Copyright (C) 2025 Hurry Curry! contributors # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, version 3 of the License only. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see . # class_name ItemFactory extends Object class ItemName: var name: String var contents: Array func _init(raw_name: String): var c = Array(raw_name.split(":")) name = c[0] contents = c[1].split(",") if c.size() > 1 else [] static func produce(raw_name: String, owned_by: Node3D) -> Item: var item: Item = produce_inner(raw_name, owned_by) item.item_name = raw_name return item static func produce_inner(raw_name: String, owned_by: Node3D) -> Item: var item = ItemName.new(raw_name) match item.name: "bun": return Bun.new(owned_by) "cheese": return Cheese.new(owned_by) "cooked-noodles": return GenericItem.new(owned_by, preload("res://map/items/cooked_noodles.tscn")) "sliced-cheese": return SlicedCheese.new(owned_by) "dirt": return GenericItem.new(owned_by, preload("res://map/items/dirt.tscn")) "sliced-bun": return GenericItem.new(owned_by, preload("res://map/items/sliced_bun.tscn")) "sliced-bun-top": return GenericItem.new(owned_by, preload("res://map/items/sliced_bun_top.tscn")) "sliced-bun-bottom": return GenericItem.new(owned_by, preload("res://map/items/sliced_bun_bottom.tscn")) "burned": return Burned.new(owned_by) "coconut": return GenericItem.new(owned_by, preload("res://map/items/coconut.tscn")) "dough": return GenericItem.new(owned_by, preload("res://map/items/dough.tscn")) "fish": return GenericItem.new(owned_by, preload("res://map/items/fish.tscn")) "flour": return GenericItem.new(owned_by, preload("res://map/items/flour.tscn")) "leek": return GenericItem.new(owned_by, preload("res://map/items/leek.tscn")) "mushroom": return GenericItem.new(owned_by, preload("res://map/items/mushroom.tscn")) "sliced-leek": return SlicedLeek.new(owned_by) "noodles": return GenericItem.new(owned_by, preload("res://map/items/noodles.tscn")) "rolled-dough": return GenericItem.new(owned_by, preload("res://map/items/rolled_dough.tscn")) "strawberry-mochi": return Mochi.new(owned_by, Color(.98, .70, .75)) "nigiri": return Nigiri.new(owned_by) "steak": return GenericItem.new(owned_by, preload("res://map/items/steak.tscn")) "seared-steak": return GenericItem.new(owned_by, preload("res://map/items/seared_steak.tscn")) "patty": return GenericItem.new(owned_by, preload("res://map/items/patty.tscn")) "seared-patty": return GenericItem.new(owned_by, preload("res://map/items/seared_patty.tscn")) "rice": return GenericItem.new(owned_by, preload("res://map/items/rice.tscn")) "sliced-fish": return GenericItem.new(owned_by, preload("res://map/items/sliced_fish.tscn")) "strawberry": return Strawberry.new(owned_by) "tomato": return Tomato.new(owned_by) # TODO: move into choppable class / move code into cutting_board "sliced-tomato": return SlicedTomato.new(owned_by) "lettuce": return GenericItem.new(owned_by, preload("res://map/items/lettuce.tscn")) "sliced-lettuce": return SlicedLettuce.new(owned_by) "potato": return Potato.new(owned_by) "sliced-potato": return GenericItem.new(owned_by, preload("res://map/items/sliced_potato.tscn")) "dirty-plate": return Plate.new(owned_by, ["dirt"]) "pot": return Pot.new(owned_by, item.contents) "basket": return Basket.new(owned_by, item.contents) "pan": return Pan.new(owned_by, item.contents) "foodprocessor": return FoodProcessor.new(owned_by, item.contents) "glass": return Glass.new(owned_by, item.contents) "plate": return Plate.new(owned_by, item.contents) "unknown-order": return GenericItem.new(owned_by, preload("res://map/items/unknown_order.tscn")) _: return UnknownItem.new(owned_by, raw_name)