League system: the league tables of the loaded game as one structure
The mutable globals of schedule.hpp (league sizes, calendar groups, promotion ladder, European places, league suffixes, newcomers, English competitions) are members of LeagueSystem in world_layout.hpp, read through league_system() and written only by the installer of a game version. Values and uses are unchanged. The size check of set_league_sizes asks the world layout for the league teams. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
74d6cde914
commit
cb6d3b6035
38 files changed
+232
-180
No files matched your search
@@ -45,7 +45,7 @@ int main(int argc, char** argv) {
|
||||
const ui::DeskRequest origin{ui::DeskRequestKind::open_menu, 0, 0, 1, 0, revision};
|
||||
auto page = session.open_league_pairings(origin, revision, error);
|
||||
check(page.has_value(), error);
|
||||
const bool english = kLeagueSizes[0] == 20;
|
||||
const bool english = league_system().sizes[0] == 20;
|
||||
const int domestic_rows = english ? 10 : 9;
|
||||
check(page->rows.size() == size_t(domestic_rows) && stable(),
|
||||
"actual career opens all nine/ten pairings without changing live state or RNG");
|
||||
@@ -58,7 +58,7 @@ int main(int argc, char** argv) {
|
||||
// Four English divisions / five German divisions, then all four foreign
|
||||
// leagues. English league 4 has no calendar group and no selector button.
|
||||
for (int league = 0; league < 9; ++league) {
|
||||
if (kLeagueBit[league] == 0xff) continue;
|
||||
if (league_system().calendar_bit[league] == 0xff) continue;
|
||||
dispatch({LeaguePairingsAction::select_league, league});
|
||||
check(page->source.total_rounds == (league < 5 ? (english ? 38 : 34) : 22),
|
||||
"round count follows the loaded domestic/foreign league");
|
||||
|
||||
Reference in new issue
Block a user