Annual general meeting and change of club

At the end of a season three groups of members vote on a human manager.
Below half of the votes he has to take over one of up to seven interested
clubs; the same list lets a manager leave on his own from the manager page.
The meeting is shown as a needle that swings between red and green and
comes to rest on the result.

Engine: assembly_vote, club_offers, change_club; read "assembly", command
manager.clubChange, field assembly of session.advance; saved in
state/modern.json. Dismissals are always on until the options offer them.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Fable 5.2 committed 2026-11-17 12:58:36 +01:00
1 parent 811edfa900
commit a2b9770d81
24 files changed
+1016 -7

No files matched your search

+15 -1
View File
@@ -186,7 +186,14 @@ void save_world_career(const std::filesystem::path& path, const World& world, co
{"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)}});
{"career_end_date", int64_t(state.career_end_date)},
{"assembly", [&] {
A rows;
for (const auto& m : state.assembly)
rows.push_back(O{{"assets", m.assets}, {"place", int64_t(m.place)}, {"voted_season", int64_t(m.voted_season)}});
return J(std::move(rows));
}()},
{"dismissals", state.dismissals}});
// The almanac: finished seasons unchanged, the running one encoded now.
for (const auto& [name, bytes] : state.almanac.finished) docs[name] = bytes;
if (state.almanac.current.season >= 0) docs["history/current.bin"] = encode_almanac_season(state.almanac.current);
@@ -256,6 +263,13 @@ SavedWorldCareer load_world_career(const std::filesystem::path& path, const Worl
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)));
}
// the annual general meeting (since 17 November 2026); older saves start without a base
if (o->count("assembly")) {
for (const J& row : arr(get(modern, "assembly")))
out.state.assembly.push_back({int64_t(num(get(row, "assets"))), int32_t(num(get(row, "place"))), int32_t(num(get(row, "voted_season")))});
if (const auto it = o->find("dismissals"); it != o->end() && std::holds_alternative<bool>(it->second.value))
out.state.dismissals = std::get<bool>(it->second.value);
}
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")));