This repository has been archived on 2026-05-24. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
AgrarianGameArchive/Scripts/verify_weather_state_persistence.py
T

49 lines
1.7 KiB
Python

from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
EXPECTED = {
ROOT / "Source" / "AgrarianGame" / "AgrarianSaveGame.h": [
"EAgrarianWeatherType Weather = EAgrarianWeatherType::Clear;",
"FAgrarianMappedWeatherInputs WeatherInputs;",
"FAgrarianWeatherDebugSnapshot WeatherDebug;",
],
ROOT / "Source" / "AgrarianGame" / "AgrarianPersistenceSubsystem.cpp": [
"SaveGame->Weather = GameState->Weather;",
"SaveGame->WeatherInputs = GameState->ActiveWeatherInputs;",
"SaveGame->WeatherDebug = GameState->GetWeatherDebugSnapshot();",
"if (SaveGame->WeatherInputs.bHasProviderData)",
"GameState->ApplyMappedWeatherInputs(SaveGame->WeatherInputs);",
"GameState->SetWeather(SaveGame->Weather);",
],
ROOT / "Docs" / "PersistenceDesignDocument.md": [
"`UAgrarianSaveGame::Weather`",
"`WeatherInputs` and `WeatherDebug` snapshots",
"reapplies the mapped weather inputs",
],
ROOT / "AGRARIAN_DEVELOPMENT_ROADMAP.md": [
"[x] Save weather seed/state.",
"`UAgrarianSaveGame::Weather`",
"provider `WeatherInputs`, and `WeatherDebug`",
],
}
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("Weather state persistence verification failed: " + "; ".join(missing))
print("PASS: weather state persists with provider inputs and enum fallback.")
if __name__ == "__main__":
main()