Fork the Classic season core into src/modern and add the world layout (M1)
- src/modern/game: the season modules as bmh::modern, working on ModernState (a GameState). Data types stay shared with Classic; Modern code calls its season functions qualified (modern::...), so a missing Modern function is a compile error instead of a silent call into Classic. - src/modern/app/modern_session: the session on the Modern core. It still uses the Classic UI projections until the Modern projections exist. - SeasonHooks: the shared match core reaches player statistics and the table prediction of the season core that owns the game (Classic: unchanged). - WorldLayout: team ranges, squad slots and pools of the running world. Shared code and the Modern fork read them; Classic keeps the original numbers. - Transfer list views moved to game/transfer_offer_view.hpp (shared). - tools/modern/check_fork_calls.sh, modern_season_sim and world_layout_tests. Verified: Classic tests and replay regression unchanged; season_sim and modern_season_sim produce identical output with Classic data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
badd08f05e
commit
f2fcb28f65
81 files changed
+29351
-91
No files matched your search
@@ -219,6 +219,7 @@ add_library(bmhcore STATIC
|
||||
src/game/source_tip.cpp
|
||||
src/game/table_forecast.cpp
|
||||
src/game/state.cpp
|
||||
src/game/world_layout.cpp
|
||||
src/game/rating.cpp
|
||||
src/game/match.cpp
|
||||
src/game/match_engine.cpp
|
||||
@@ -273,6 +274,17 @@ else()
|
||||
target_compile_options(bmhcore PRIVATE -Wall -Wextra)
|
||||
endif()
|
||||
|
||||
# Modern season core: a fork of the Classic season sources (docs/new_engine) that shares
|
||||
# formats, GameState and the match core with Classic through bmhcore.
|
||||
file(GLOB BMH_SEASON_MODERN_SOURCES CONFIGURE_DEPENDS src/modern/game/*.cpp)
|
||||
add_library(bmh_season_modern STATIC ${BMH_SEASON_MODERN_SOURCES})
|
||||
target_link_libraries(bmh_season_modern PUBLIC bmhcore)
|
||||
if(MSVC)
|
||||
target_compile_options(bmh_season_modern PRIVATE /W4 /utf-8 /bigobj)
|
||||
else()
|
||||
target_compile_options(bmh_season_modern PRIVATE -Wall -Wextra)
|
||||
endif()
|
||||
|
||||
add_executable(openbmh_inspect src/main.cpp)
|
||||
target_link_libraries(openbmh_inspect PRIVATE bmhcore ${BMH_SDL_TARGET})
|
||||
if(MSVC)
|
||||
@@ -326,6 +338,16 @@ endif()
|
||||
|
||||
add_subdirectory(src/ui)
|
||||
add_subdirectory(src/import)
|
||||
|
||||
# Modern session: fork of the Classic CareerSession on the Modern season core. It still
|
||||
# uses the Classic UI projections until the Modern projections exist (docs/new_engine).
|
||||
add_library(bmh_modern_session STATIC src/modern/app/modern_session.cpp)
|
||||
target_link_libraries(bmh_modern_session PUBLIC bmh_season_modern bmhui)
|
||||
if(MSVC)
|
||||
target_compile_options(bmh_modern_session PRIVATE /W4 /utf-8 /bigobj)
|
||||
else()
|
||||
target_compile_options(bmh_modern_session PRIVATE -Wall -Wextra)
|
||||
endif()
|
||||
option(OPENBMH_BUILD_EDITOR "Build the standalone OBW editor" OFF)
|
||||
if(OPENBMH_BUILD_EDITOR)
|
||||
add_subdirectory(src/editor)
|
||||
@@ -616,6 +638,12 @@ target_link_libraries(season_sim PRIVATE bmhui)
|
||||
if(MSVC)
|
||||
target_compile_options(season_sim PRIVATE /utf-8)
|
||||
endif()
|
||||
# The Modern fork of season_sim; with Classic data its output must equal season_sim's.
|
||||
add_executable(modern_season_sim tests/modern_season_sim.cpp)
|
||||
target_link_libraries(modern_season_sim PRIVATE bmh_modern_session)
|
||||
if(MSVC)
|
||||
target_compile_options(modern_season_sim PRIVATE /utf-8)
|
||||
endif()
|
||||
|
||||
# Headless terminal/protocol client; owns no game logic and has no SDL dependency.
|
||||
add_executable(openbmh_cli
|
||||
@@ -1111,6 +1139,10 @@ if(MSVC)
|
||||
endif()
|
||||
add_test(NAME quit_confirmation_unit_tests COMMAND quit_confirmation_unit_tests)
|
||||
|
||||
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(fixture_table_tests tests/fixture_table_tests.cpp)
|
||||
target_link_libraries(fixture_table_tests PRIVATE bmhcore)
|
||||
add_test(NAME fixture_table_unit_tests COMMAND fixture_table_tests)
|
||||
|
||||
Reference in new issue
Block a user