World layout: team id ranges and the squad slot table as data

WorldLayout names the dimensions of a game world (league clubs, amateurs,
foreign cup clubs, the pseudo team, national teams, squad slots and pools).
classic_world_layout() holds the numbers of the original; squad_range() and
team_average() ask it instead of literals. A test compares squad_range() with
the former arithmetic for every team id and checks that inconsistent layouts
are refused.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude committed 2026-11-10 21:19:54 +01:00
1 parent 0bcb0d2507
commit 74d6cde914
5 files changed
+210 -10

No files matched your search

+6
View File
@@ -271,6 +271,7 @@ add_library(bmhcore STATIC
src/game/career.cpp
src/game/save.cpp
src/game/digest.cpp
src/game/world_layout.cpp
src/game/turn.cpp
src/game/turn_driver.cpp
)
@@ -1187,6 +1188,11 @@ add_executable(classic_rules_unit_tests tests/classic_rules_unit_tests.cpp)
target_link_libraries(classic_rules_unit_tests PRIVATE bmhcore)
add_test(NAME classic_rules_unit_tests COMMAND classic_rules_unit_tests)
# The Classic world layout equals the numbers the engine used as literals (no game data needed).
add_executable(world_layout_tests tests/world_layout_tests.cpp)
target_link_libraries(world_layout_tests PRIVATE bmhcore)
add_test(NAME world_layout_tests COMMAND world_layout_tests)
add_executable(season_player_reset_tests tests/season_player_reset_tests.cpp)
target_link_libraries(season_player_reset_tests PRIVATE bmhcore)
add_test(NAME season_player_reset_tests COMMAND season_player_reset_tests)