# 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 TileFactory extends Object class TileCC: var tile_name: String var position: Vector2i var neighbors: Array var floor_meshers: Dictionary[String, FloorMesher] var floor_meshers: Dictionary[String, FloorMesher] = { "floor": FloorMesher.new(Floor.floor_mesh()), "path": FloorMesher.new(Path.floor_mesh()), "grass": GrassMesher.new(Grass.floor_mesh()), "street": FloorMesher.new(Street.floor_mesh()) } func produce(tile_name: String, position: Vector2i, neighbors: Array) -> Tile: var ctx := TileCC.new() ctx.tile_name = tile_name ctx.position = position ctx.neighbors = neighbors ctx.floor_meshers = floor_meshers 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) "cutting-board": 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) "rolling-board": return RollingBoard.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) "house-balcony": return HouseBalcony.new(ctx) "house-door": return HouseDoor.new(ctx) "house-oriel": return HouseOriel.new(ctx) "house-wall": return HouseWall.new(ctx) "house-side": return HouseSide.new(ctx) "house-roof": return HouseRoof.new(ctx) "house-roof-chimney": return HouseRoofChimney.new(ctx) "bun-crate": return BunCrate.new(ctx) "cheese-crate": return CheeseCrate.new(ctx) "coconut-crate": return CoconutCrate.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 SteakCrate.new(ctx) "rice-crate": return RiceCrate.new(ctx) "strawberry-crate": return StrawberryCrate.new(ctx) "tomato-crate": return TomatoCrate.new(ctx) "potato-crate": return PotatoCrate.new(ctx) var t: push_warning("tile %s unknown" % t) return GenericTile.new(ctx)