aboutsummaryrefslogtreecommitdiff
path: root/client/map/tile_factory.gd
blob: 8483c744606cf1317769a9031a758f37fa47260b (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Hurry Curry! - a game about cooking
# Copyright 2024 nokoe
#
# 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 TileFactory
extends Object

class TileCC:
	var tile_name: String
	var position: Vector2i
	var neighbors: Array
	var floor_mesher: FloorMesher
	var portal_type: bool


static func produce(tile_name: String, position: Vector2i, neighbors: Array, floor_mesher: FloorMesher) -> Tile:
	var ctx := TileCC.new()
	ctx.tile_name = tile_name
	ctx.position = position
	ctx.neighbors = neighbors
	ctx.floor_mesher = floor_mesher
	match tile_name:
		"black-hole-counter": return ItemPortal.new(ctx, false)
		"black-hole": return PlayerPortal.new(ctx, false)
		"book": return Book.new(ctx)
		"ceiling-lamp": return CeilingLamp.new(ctx)
		"chair": return Chair.new(ctx)
		"chandelier": return Chandelier.new(ctx)
		"conveyor": return Conveyor.new(ctx)
		"counter-window": return CounterWindow.new(ctx)
		"counter": return CounterBase.new(ctx)
		"cuttingboard": return CuttingBoard.new(ctx)
		"door": return Door.new(ctx)
		"fence": return Fence.new(ctx)
		"floor": return Floor.new(ctx)
		"freezer": return Freezer.new(ctx)
		"grass": return Grass.new(ctx)
		"lamp": return Lamp.new(ctx)
		"oven": return Oven.new(ctx)
		"path": return Path.new(ctx)
		"sink": return Sink.new(ctx)
		"stove": return Stove.new(ctx)
		"street": return Street.new(ctx)
		"table": return Table.new(ctx)
		"trash": return Trash.new(ctx)
		"tree": return ExteriorTree.new(ctx)
		"wall-window": return WallWindow.new(ctx)
		"wall": return Wall.new(ctx)
		"white-hole-counter": return ItemPortal.new(ctx, true)
		"white-hole": return PlayerPortal.new(ctx, true)

		"cheese-crate": return CheeseCrate.new(ctx)
		"coconut-crate": return CoconutCrate.new(ctx)
		"dirty-plate-crate": return CounterBase.new(ctx)
		"fish-crate": return FishCrate.new(ctx)
		"flour-crate": return FlourCrate.new(ctx)
		"leek-crate": return LeekCrate.new(ctx)
		"lettuce-crate": return LettuceCrate.new(ctx)
		"steak-crate": return RawSteakCrate.new(ctx)
		"rice-crate": return RiceCrate.new(ctx)
		"strawberry-crate": return StrawberryCrate.new(ctx)
		"tomato-crate": return TomatoCrate.new(ctx)

		var t:
			push_warning("tile %s unknown" % t)
			return GenericTile.new(ctx)