SaveLoadManager (Orchestrator)

Overview

Central coordinator that invokes all subsystem managers in a fixed order. Optionally auto-loads at startup if a flag is set; otherwise resets Atom variables to their InitialValue.

References

  • AtomSaveLoadManager atomManager
  • RuntimeSaveLoadManager runtimeManager
  • MapSaveLoadManager mapManager
  • UpgradeSaveLoadManager upgradeManager
  • BoolVariable shouldLoadData

Startup Behavior

On Start():

  • If shouldLoadData.Value == true: calls LoadAll() then sets the flag to false.
  • Else: calls atomManager.ResetAll().

Reset() auto-finds any missing manager references in the scene.

Call Order

The manager intentionally preserves this order for both save and load:

  1. Atoms
  2. Runtime objects (Laboratories, Distribution Spots, Routes)
  3. Regions
  4. Upgrades

Public API

  • void SaveAll() / void LoadAll() — invoke each subsystem in order.
  • void ClearAllSavedData() — deletes all known save files, then resets Atoms.
  • void SaveAndQuit() — saves everything, then QuitGame().
  • void QuitGame() — loads scene index 0.
  • static bool HasSavedData() — returns true only if all four save files exist.

Save Files Affected

  • atoms_save.json, runtime_save.json, regions_save.json, upgrades_save.json.