Modern press journal: monthly results

At the first kickoff of a new month each club manager's cash change over
the month just ended becomes finance.profit or finance.loss. The month
and the cash at its start are saved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-27 18:46:54 +01:00
1 parent d6d31f939d
commit 706577d002
5 files changed
+43 -1

No files matched your search

+6
View File
@@ -156,6 +156,8 @@ void save_world_career(const std::filesystem::path& path, const World& world, co
{"traffic_scale", int64_t(state.traffic_scale)},
{"press", press_json(state.press)},
{"press_serial", int64_t(state.press_serial)},
{"press_month", int64_t(state.press_month)},
{"press_month_cash", [&] { A a; for (int64_t v : state.press_month_cash) a.push_back(v); return J(std::move(a)); }()},
{"career_end_reason", state.career_end_reason},
{"career_end_date", int64_t(state.career_end_date)}});
// The almanac: finished seasons unchanged, the running one encoded now.
@@ -217,6 +219,10 @@ SavedWorldCareer load_world_career(const std::filesystem::path& path, const Worl
out.state.press = press_json(get(modern, "press"));
out.state.press_serial = uint32_t(num(get(modern, "press_serial")));
}
if (o->count("press_month")) {
out.state.press_month = uint32_t(num(get(modern, "press_month")));
for (const J& v : arr(get(modern, "press_month_cash"))) out.state.press_month_cash.push_back(int64_t(num(v)));
}
if (o->count("career_end_reason")) {
out.state.career_end_reason = str(get(modern, "career_end_reason"));
out.state.career_end_date = uint32_t(num(get(modern, "career_end_date")));