()
| 453 | |
| 454 | |
| 455 | def _build_items(): |
| 456 | def csv_record_to_objects(info): |
| 457 | yield ItemPocket(id=int(info[0]), name=info[1]) |
| 458 | |
| 459 | build_generic((ItemPocket,), "item_pockets.csv", csv_record_to_objects) |
| 460 | |
| 461 | def csv_record_to_objects(info): |
| 462 | yield ItemPocketName( |
| 463 | item_pocket_id=int(info[0]), language_id=int(info[1]), name=info[2] |
| 464 | ) |
| 465 | |
| 466 | build_generic((ItemPocketName,), "item_pocket_names.csv", csv_record_to_objects) |
| 467 | |
| 468 | def csv_record_to_objects(info): |
| 469 | yield ItemFlingEffect(id=int(info[0]), name=info[1]) |
| 470 | |
| 471 | build_generic((ItemFlingEffect,), "item_fling_effects.csv", csv_record_to_objects) |
| 472 | |
| 473 | def csv_record_to_objects(info): |
| 474 | yield ItemFlingEffectEffectText( |
| 475 | item_fling_effect_id=int(info[0]), |
| 476 | language_id=int(info[1]), |
| 477 | effect=scrub_str(info[2]), |
| 478 | ) |
| 479 | |
| 480 | build_generic( |
| 481 | (ItemFlingEffectEffectText,), |
| 482 | "item_fling_effect_prose.csv", |
| 483 | csv_record_to_objects, |
| 484 | ) |
| 485 | |
| 486 | def csv_record_to_objects(info): |
| 487 | yield ItemCategory(id=int(info[0]), item_pocket_id=int(info[1]), name=info[2]) |
| 488 | |
| 489 | build_generic((ItemCategory,), "item_categories.csv", csv_record_to_objects) |
| 490 | |
| 491 | def csv_record_to_objects(info): |
| 492 | yield ItemCategoryName( |
| 493 | item_category_id=int(info[0]), language_id=int(info[1]), name=info[2] |
| 494 | ) |
| 495 | |
| 496 | build_generic((ItemCategoryName,), "item_category_prose.csv", csv_record_to_objects) |
| 497 | |
| 498 | def csv_record_to_objects(info): |
| 499 | yield Item( |
| 500 | id=int(info[0]), |
| 501 | name=info[1], |
| 502 | item_category_id=int(info[2]), |
| 503 | cost=int(info[3]), |
| 504 | fling_power=int(info[4]) if info[4] != "" else None, |
| 505 | item_fling_effect_id=int(info[5]) if info[5] != "" else None, |
| 506 | ) |
| 507 | |
| 508 | build_generic((Item,), "items.csv", csv_record_to_objects) |
| 509 | |
| 510 | def csv_record_to_objects(info): |
| 511 | if re.search(r"^data-card", info[1]): |
| 512 | file_name = "data-card.png" |
no test coverage detected