pass the tests

This commit is contained in:
Junhan Chang
2025-10-11 07:20:34 +08:00
parent 88c4d1a9d1
commit 25d46dc9d5
5 changed files with 51 additions and 91 deletions

View File

@@ -610,10 +610,17 @@ def resource_bioyond_to_plr(bioyond_materials: list[dict], type_mapping: dict =
+ (detail.get("y", 0) - 1)
)
bottle = plr_material[number]
if detail["name"] in type_mapping:
# plr_material.unassign_child_resource(bottle)
plr_material.sites[number] = None
plr_material[number] = initialize_resource(
{"name": f'{detail["name"]}_{number}', "class": type_mapping[detail["name"]]}, resource_type=ResourcePLR
)
else:
bottle.tracker.liquids = [
(detail["name"], float(detail.get("quantity", 0)) if detail.get("quantity") else 0)
]
bottle.code = detail.get("code", "")
bottle.tracker.liquids = [
(detail["name"], float(detail.get("quantity", 0)) if detail.get("quantity") else 0)
]
else:
bottle = plr_material[0] if plr_material.capacity > 0 else plr_material
bottle.tracker.liquids = [