summaryrefslogtreecommitdiff
path: root/client/map/item_factory.gd
blob: 6cd160c1e80e110f9fbb1189853c3055f82d8084 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# 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 <https://www.gnu.org/licenses/>.
#
class_name ItemFactory
extends Object

static func produce(full_name: String, owned_by: Node3D) -> Item:
	var item = Global.ParsedItem.new(full_name)
	
	match item.name:
		"bun": return Bun.new(owned_by)
		"cheese": return Cheese.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)
		"strawberry-icecream": return Icecream.new(owned_by, Color(.98, .55, .71))
		"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)