Add the base read queries for the new UI; fix ages and save limits

- ModernSession::read(request): status, leagues, table, fixtures and
  squad as JSON with the same club/player/league objects everywhere
  (docs/new_engine/ui-abfragen.md); the statistics answer through it.
  Further queries follow per menu once the GUI is finished.
- Ages: data set 1.3 gives ages only for the 840 added players (birth
  dates); the 2574 original players carry the placeholder 16 and now
  get their age drawn as in the original (human squad 20-25) instead
  of all being 16. Birth dates for all players go into data 1.4.
- Saves of Modern matchdays with more than six match groups (nine
  leagues on one day) were refused on loading; Classic keeps six.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Opus 5.5 committed 2026-10-24 10:52:44 +02:00
1 parent f92be693af
commit 4639fe5a91
12 files changed
+344 -8

No files matched your search

+8
View File
@@ -52,6 +52,9 @@ struct ModernState : GameState {
std::vector<TrainingCamp> training_camps;
// The football almanac (docs/new_engine/almanach.md): every match of the career.
Almanac almanac;
// Players whose age the data set gives (birth date); the others carry a placeholder the
// career start replaces as in the original. Needed only while a career starts (not saved).
std::vector<bool> world_age_known;
ModernState() { season_hooks = &modern::season_hooks(); }
// Takes over a state built by shared code (save loading, career setup).
@@ -66,4 +69,9 @@ inline bool keeps_world_values(const ModernState& g, int player) {
!g.world_player_id[size_t(player)].starts_with("player:gen-");
}
// A player of the data set whose age it gives (balance.md).
inline bool keeps_world_age(const ModernState& g, int player) {
return keeps_world_values(g, player) && size_t(player) < g.world_age_known.size() && g.world_age_known[size_t(player)];
}
} // namespace bmh::modern