from pathlib import Path


ROOT = Path(__file__).resolve().parents[1]
FILES = {
    "AgrarianDebugHUD.h": ROOT / "Source" / "AgrarianGame" / "AgrarianDebugHUD.h",
    "AgrarianDebugHUD.cpp": ROOT / "Source" / "AgrarianGame" / "AgrarianDebugHUD.cpp",
    "AgrarianGamePlayerController.h": ROOT / "Source" / "AgrarianGame" / "AgrarianGamePlayerController.h",
    "AgrarianGamePlayerController.cpp": ROOT / "Source" / "AgrarianGame" / "AgrarianGamePlayerController.cpp",
    "AGRARIAN_DEVELOPMENT_ROADMAP.md": ROOT / "AGRARIAN_DEVELOPMENT_ROADMAP.md",
}

EXPECTED = {
    "AgrarianDebugHUD.h": [
        "bShowDebugDevMenu",
        "DrawDebugDevMenu",
    ],
    "AgrarianDebugHUD.cpp": [
        "DrawDebugDevMenu()",
        "DEV MENU",
        "AgrarianShowMvpScreen main|character|join|loading",
        "AgrarianSaveWorld / AgrarianLoadWorld",
        "AgrarianRespawn / AgrarianHeal",
    ],
    "AgrarianGamePlayerController.h": [
        "AgrarianToggleDebugDevMenu",
    ],
    "AgrarianGamePlayerController.cpp": [
        "AgrarianToggleDebugDevMenu",
        "bShowDebugDevMenu = !AgrarianHUD->bShowDebugDevMenu",
        "MVP debug/dev menu shown.",
    ],
    "AGRARIAN_DEVELOPMENT_ROADMAP.md": [
        "[x] Add debug/dev menu.",
        "`AgrarianToggleDebugDevMenu`",
    ],
}


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

    if missing:
        raise RuntimeError("MVP debug/dev menu verification failed: " + "; ".join(missing))

    print("Agrarian MVP debug/dev menu verification complete.")


if __name__ == "__main__":
    main()
