# 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 ParsedItem: var name: String var contents: Array func _init(full_name: String): var c = Array(full_name.split(":")) name = c[0] contents = c[1].split(",") if c.size() > 1 else [] static func produce(full_name: String, owned_by: Node3D) -> Item: var item = ParsedItem.new(full_name) match item.name: "bun": return Bun.new(owned_by) "cheese": return Cheese.new(owned_by) "cooked-noodles": return CookedNoodles.new(owned_by) "sliced-cheese": return SlicedCheese.new(owned_by) "dirt": return Dirt.new(owned_by) "sliced-bun": return SlicedBun.new(owned_by) "sliced-bun-top": return SlicedBunTop.new(owned_by) "sliced-bun-bottom": return SlicedBunBottom.new(owned_by) "burned": return Burned.new(owned_by) "coconut": return Coconut.new(owned_by) "dough": return Dough.new(owned_by) "fish": return Fish.new(owned_by) "flour": return Flour.new(owned_by) "leek": return Leek.new(owned_by) "noodles": return Noodles.new(owned_by) "rolled-dough": return RolledDough.new(owned_by) "strawberry-mochi": return Mochi.new(owned_by, Color(.98, .70, .75)) "nigiri": return Nigiri.new(owned_by) "steak": return Steak.new(owned_by) "seared-steak": return SearedSteak.new(owned_by) "patty": return Patty.new(owned_by) "seared-patty": return SearedPatty.new(owned_by) "rice": return Rice.new(owned_by) "sliced-fish": return SlicedFish.new(owned_by) "strawberry": return Strawberry.new(owned_by) "tomato": return Tomato.new(owned_by) "sliced-tomato": return SlicedTomato.new(owned_by) "lettuce": return Lettuce.new(owned_by) "sliced-lettuce": return SlicedLettuce.new(owned_by) "dirty-plate": return Plate.new(owned_by, ["dirt"]) "pot": return Pot.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 UnknownOrder.new(owned_by) _: return GenericItem.new(owned_by, full_name)