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

+6
View File
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-only
#include "formats/executable_layout.hpp"
#pragma once
#include "modern/content/projections.hpp"
#include "modern/content/statistics.hpp"
#include "modern/content/world_expand.hpp"
// The engine side of the UI's career handoff (src/ui/flow.hpp, ENGINE_BINDING.md).
@@ -817,6 +818,11 @@ public:
// The game statistics menu (docs/new_engine/statistik.md): winners by season, player
// statistics per competition. Read-only; answers {ok, ...} or {ok: false, error}.
cli::Json read_statistics(const cli::Json& request) const { return query_statistics(g_, request); }
// The read queries of the new interface (docs/new_engine/ui-abfragen.md): status, leagues,
// table, fixtures, squad and the statistics, for the manager at the desk. Read-only.
cli::Json read(const cli::Json& request) const {
return query_projection(g_, int(g_.memory.has(::bmh::layout::ActiveManager) ? g_.memory.u8(::bmh::layout::ActiveManager) : 0), request);
}
ModernState& state() { return g_; }
const TurnResultSnapshot& last_turn_results() const { return turn_driver_.last_results; }
// Owned presentation for the event completed by the last accepted kickoff.