refactor(items): use ItemType enum and offset constants in ChestItemData/RoomChestConfig

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Steven Wroblewski
2026-05-09 01:01:50 +02:00
parent b97b110876
commit 4e4743f14f
3 changed files with 65 additions and 41 deletions
+16 -1
View File
@@ -4,7 +4,7 @@ extends GutTest
func test_chest_item_data_default_item_type_is_holdable() -> void:
var d: ChestItemData = ChestItemData.new()
assert_eq(d.item_type, "holdable")
assert_eq(d.item_type, ChestItemData.ItemType.HOLDABLE)
func test_chest_item_data_default_outfit_layer_is_one() -> void:
@@ -20,3 +20,18 @@ func test_room_chest_config_reception_desk_has_three_items() -> void:
func test_room_chest_config_unknown_id_returns_empty() -> void:
var items: Array[ChestItemData] = RoomChestConfig.get_items("does_not_exist")
assert_eq(items.size(), 0)
func test_room_chest_config_reception_desk_first_item_fields() -> void:
var items: Array[ChestItemData] = RoomChestConfig.get_items("reception_desk")
assert_eq(items[0].item_id, "clipboard")
assert_eq(items[0].item_type, ChestItemData.ItemType.HOLDABLE)
assert_eq(items[0].spawn_offset, Vector2(-70.0, -60.0))
func test_room_chest_config_patient_cabinet_stethoscope_outfit_layer_two() -> void:
var items: Array[ChestItemData] = RoomChestConfig.get_items("patient_cabinet")
var stethoscope: ChestItemData = items[1]
assert_eq(stethoscope.item_id, "stethoscope")
assert_eq(stethoscope.item_type, ChestItemData.ItemType.OUTFIT)
assert_eq(stethoscope.outfit_layer, 2)