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:
1 parent
f92be693af
commit
4639fe5a91
12 files changed
+344
-8
No files matched your search
@@ -2,6 +2,7 @@
|
||||
#include "content/save.hpp"
|
||||
#include "import/detail.hpp"
|
||||
#include "game/save.hpp"
|
||||
#include "game/world_layout.hpp"
|
||||
#include <limits>
|
||||
#include <algorithm>
|
||||
#include <bit>
|
||||
@@ -107,7 +108,10 @@ J groups_json(const std::vector<MatchGroup> &groups) {
|
||||
std::vector<MatchGroup> groups_json(const J &j) {
|
||||
std::vector<MatchGroup> groups;
|
||||
const auto &rows = arr(j);
|
||||
if (rows.size() > 6)
|
||||
// The original has six group descriptors. A Modern world plays more competitions on one
|
||||
// day (nine leagues and the cups); its groups beyond the sixth live in the turn driver.
|
||||
const size_t max_groups = world_layout().league_teams == classic_world_layout().league_teams ? 6 : 16;
|
||||
if (rows.size() > max_groups)
|
||||
fail("too many match groups");
|
||||
for (const auto &row : rows)
|
||||
groups.push_back(group_json(row));
|
||||
|
||||
Reference in new issue
Block a user