from pathlib import Path


ROOT = Path(__file__).resolve().parents[1]

EXPECTED = {
    ROOT / "Scripts" / "setup_item_definitions.py": [
        '"asset": "DA_Item_SimpleContainer"',
        '"item_id": "simple_container"',
        '"display_name": "Simple Container"',
        "early storage, trade, and later placed-container systems",
    ],
    ROOT / "Scripts" / "verify_item_definitions.py": [
        '"DA_Item_SimpleContainer": ("simple_container", unreal.AgrarianItemType.STRUCTURE)',
    ],
    ROOT / "Scripts" / "setup_recipe_definitions.py": [
        '"asset": "DA_Recipe_SimpleContainer"',
        '"recipe_id": "simple_container"',
        '("wood", 3)',
        '("fiber", 6)',
        '("hide", 2)',
        '"result": ("simple_container", 1)',
    ],
    ROOT / "Scripts" / "verify_recipe_definitions.py": [
        '"DA_Recipe_SimpleContainer"',
        '"ingredients": {"wood": 3, "fiber": 6, "hide": 2}',
        '"result": ("simple_container", 1)',
    ],
    ROOT / "AGRARIAN_DEVELOPMENT_ROADMAP.md": [
        "[x] Add simple container recipe.",
    ],
    ROOT / "Docs" / "TechnicalDesignDocument.md": [
        "`simple_container`",
        "foundation for later placed storage and trade-container systems",
    ],
    ROOT / "Docs" / "InventoryDataModel.md": [
        "The 0.1.G `simple_container` recipe is intentionally only a craftable inventory",
        "actual placed-container inventory, permissions, volume",
    ],
}


def main() -> None:
    missing = []
    for path, snippets in EXPECTED.items():
        text = path.read_text(encoding="utf-8")
        for snippet in snippets:
            if snippet not in text:
                missing.append(f"{path.relative_to(ROOT)}: {snippet}")

    if missing:
        raise RuntimeError("Simple container recipe verification failed: " + "; ".join(missing))

    print("PASS: simple container item and recipe definitions are scripted, verified, and tracked in the roadmap.")


if __name__ == "__main__":
    main()
