Modern: national teams play with squads of their nationality (M9)
A Modern layout gives every national team after no_team 24 squad slots. On each national team day, after the German nomination, the strongest fit players of each nationality (quotas 3/5/7/5, the German strength measure) fill its squad and get a computer line-up; a nation without a goalkeeper or with fewer than 14 nominees keeps its drawn rating. The shared match core asks fields_players() instead of 'league club or no_team', which is the same set in Classic. National squads get no cards or injuries, their players develop after the match like Germany's, and the almanac records their line-ups. Diamond data 1.5: 24 of 61 nations play with players. Classic regression (game 1 and two-player) unchanged, Classic-data season identical, save round trip identical, ctest passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
96e88c9579
commit
0f36b507d4
17 files changed
+154
-22
No files matched your search
@@ -37,6 +37,9 @@ int WorldLayout::team_of_slot(int slot) const {
|
||||
return int(it - squad_start.begin()) - 1;
|
||||
}
|
||||
if (uint32_t(slot) >= pool_end && uint32_t(slot) < pool_end + no_team_slots) return no_team();
|
||||
if (national_slots != 0 && uint32_t(slot) >= national_start &&
|
||||
uint32_t(slot) < national_start + uint32_t(national_teams - 1) * national_slots)
|
||||
return no_team() + 1 + int((uint32_t(slot) - national_start) / national_slots);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -60,6 +63,10 @@ void set_world_layout(WorldLayout layout) {
|
||||
layout.foreign_offers != layout.free_agents + 80 || layout.pool_end != layout.foreign_offers + 20 ||
|
||||
layout.total_slots < layout.pool_end + layout.no_team_slots)
|
||||
throw std::invalid_argument("world layout: pools must follow the squads");
|
||||
if (layout.national_slots != 0 &&
|
||||
(layout.national_start < layout.pool_end + layout.no_team_slots || layout.national_teams < 1 ||
|
||||
layout.total_slots < layout.national_start + uint32_t(layout.national_teams - 1) * layout.national_slots))
|
||||
throw std::invalid_argument("world layout: national squads must follow the no-club squad");
|
||||
// Squad slot values hold 12-bit player ids; loans store 10-bit club ids.
|
||||
if (layout.total_teams() > 1023) throw std::invalid_argument("world layout: too many teams");
|
||||
current() = std::move(layout);
|
||||
|
||||
Reference in new issue
Block a user