from pathlib import Path


ROOT = Path(__file__).resolve().parents[1]
FILES = {
    "AgrarianMvpFrontendWidget.h": ROOT / "Source" / "AgrarianGame" / "AgrarianMvpFrontendWidget.h",
    "AgrarianMvpFrontendWidget.cpp": ROOT / "Source" / "AgrarianGame" / "AgrarianMvpFrontendWidget.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 = {
    "AgrarianMvpFrontendWidget.h": [
        "UAgrarianMvpFrontendWidget",
        "EAgrarianMvpFrontendScreen",
        "MainMenu",
        "MainMenuTitle",
        "MVP investor build",
        "PrimaryActionLabel",
        "UiScale",
    ],
    "AgrarianMvpFrontendWidget.cpp": [
        "DrawMainMenu",
        "Placeholder flow",
        "FMath::Clamp(UiScale",
    ],
    "AgrarianGamePlayerController.h": [
        "MvpFrontendWidgetClass",
        "MvpFrontendWidget",
    ],
    "AgrarianGamePlayerController.cpp": [
        "UAgrarianMvpFrontendWidget::StaticClass()",
        "EAgrarianMvpFrontendScreen::MainMenu",
        "AddToPlayerScreen(10)",
    ],
    "AGRARIAN_DEVELOPMENT_ROADMAP.md": [
        "[x] Add main menu placeholder.",
        "UAgrarianMvpFrontendWidget",
    ],
}


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 main menu placeholder verification failed: " + "; ".join(missing))

    print("Agrarian MVP main menu placeholder verification complete.")


if __name__ == "__main__":
    main()
