Record every match in a football almanac (Modern, M8)
Modern careers keep every match they play: season, date, competition type, league or cup stage, matchday, both clubs by world id with their human managers, result with extra time and shoot-out, referee, attendance, weather, both line-ups and all events (goals with assists and kind, misses, cards, injuries, substitutions, shoot-out kicks). Events come from the group event log the engine keeps for every match, substitutions from the players on the pitch after each minute; nothing draws random numbers (a 60-turn Modern run is unchanged). Player indices reused for a new person get a new stable id. Saves hold finished seasons as immutable history/season-<year>.bin files plus the running season; modern-state@1.1 adds league names and the id counter. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
57d75ab2f5
commit
201eef88e4
14 files changed
+935
-8
No files matched your search
@@ -394,6 +394,15 @@ ExpandReport expand_to_world(ModernState& g, const World& world) {
|
||||
g.world_club_id.assign(size_t(new_total), {});
|
||||
g.world_club_name.assign(size_t(new_total), {});
|
||||
g.world_club_short.assign(size_t(new_total), {});
|
||||
g.world_league_id.clear(), g.world_league_name.clear();
|
||||
for (const WorldLeague& l : world.leagues) {
|
||||
if (size_t(l.index) >= g.world_league_id.size()) {
|
||||
g.world_league_id.resize(size_t(l.index) + 1);
|
||||
g.world_league_name.resize(size_t(l.index) + 1);
|
||||
}
|
||||
g.world_league_id[size_t(l.index)] = l.id;
|
||||
g.world_league_name[size_t(l.index)] = l.name;
|
||||
}
|
||||
for (int n = 0; n < new_total; ++n)
|
||||
if (const WorldClub* c = club_at[size_t(n)]) {
|
||||
g.world_club_id[size_t(n)] = c->id;
|
||||
|
||||
Reference in new issue
Block a user