#pragma once // Per-hero data of other mods, saved with the hero's inventory JSON (save // games and hero files, src/mods/inventory_save.cpp) under "hero": {key: ...}. #include namespace mods::inventory_save { // `hero`: the hero's inventory index (= its creature id, below the chest's 0x11). using HeroDataWriteFn = nlohmann::json (*)(unsigned hero); // null: nothing to save using HeroDataReadFn = void (*)(unsigned hero, const nlohmann::json& data); // Call at startup (static initialisation). void RegisterHeroData(const char* key, HeroDataWriteFn write, HeroDataReadFn read); } // namespace mods::inventory_save