## RoomChestConfig — static item configuration for all room chests.
## Maps chest_id strings to ChestItemData arrays. No assets needed: item_id strings only.
class_name RoomChestConfig

const _OFFSET_LEFT: Vector2 = Vector2(-70.0, -60.0)
const _OFFSET_CENTER: Vector2 = Vector2(0.0, -80.0)
const _OFFSET_RIGHT: Vector2 = Vector2(70.0, -60.0)
const _OFFSET_LEFT_2: Vector2 = Vector2(-50.0, -60.0)
const _OFFSET_RIGHT_2: Vector2 = Vector2(50.0, -60.0)


static func get_items(chest_id: String) -> Array[ChestItemData]:
	match chest_id:
		"reception_desk":
			return _make([
				["clipboard", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_LEFT],
				["pen", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_CENTER],
				["bandage", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_RIGHT],
			])
		"giftshop_shelf":
			return _make([
				["gift_box", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_LEFT],
				["ribbon", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_CENTER],
				["balloon", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_RIGHT],
			])
		"restaurant_counter":
			return _make([
				["teacup", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_LEFT],
				["plate", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_CENTER],
				["spoon", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_RIGHT],
			])
		"emergency_cabinet":
			return _make([
				["bandage_roll", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_LEFT],
				["syringe", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_CENTER],
				["ice_pack", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_RIGHT],
			])
		"xray_cabinet":
			return _make([
				["xray_sheet", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_LEFT],
				["lead_apron", ChestItemData.ItemType.OUTFIT, 1, _OFFSET_CENTER],
				["marker", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_RIGHT],
			])
		"pharmacy_medicine":
			return _make([
				["pill_bottle", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_LEFT_2],
				["syrup", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_RIGHT_2],
			])
		"pharmacy_tools":
			return _make([
				["mortar", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_LEFT_2],
				["spatula", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_RIGHT_2],
			])
		"lab_bench":
			return _make([
				["test_tube", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_LEFT],
				["pipette", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_CENTER],
				["microscope_slide", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_RIGHT],
			])
		"patient_cabinet":
			return _make([
				["thermometer", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_LEFT],
				["stethoscope", ChestItemData.ItemType.OUTFIT, 2, _OFFSET_CENTER],
				["pillow", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_RIGHT],
			])
		"ultrasound_cart":
			return _make([
				["gel_tube", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_LEFT],
				["probe", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_CENTER],
				["towel", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_RIGHT],
			])
		"delivery_cabinet":
			return _make([
				["swaddle", ChestItemData.ItemType.OUTFIT, 1, _OFFSET_LEFT],
				["scissors", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_CENTER],
				["cord_clamp", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_RIGHT],
			])
		"nursery_shelf":
			return _make([
				["bottle", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_LEFT],
				["rattle", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_CENTER],
				["blanket", ChestItemData.ItemType.OUTFIT, 1, _OFFSET_RIGHT],
			])
		"garden_table":
			return _make([
				["teapot", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_LEFT_2],
				["cake", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_RIGHT_2],
			])
		"garden_storage":
			return _make([
				["confetti", ChestItemData.ItemType.HOLDABLE, 1, _OFFSET_LEFT_2],
				["party_hat", ChestItemData.ItemType.OUTFIT, 1, _OFFSET_RIGHT_2],
			])
	return []


static func _make(data: Array) -> Array[ChestItemData]:
	var result: Array[ChestItemData] = []
	for entry: Array in data:
		assert(entry.size() == 4, "ChestItemData entry must have 4 elements: " + str(entry))
		var d: ChestItemData = ChestItemData.new()
		d.item_id = entry[0]
		d.item_type = entry[1]
		d.outfit_layer = entry[2]
		d.spawn_offset = entry[3]
		result.append(d)
	return result
