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
@@ -24,6 +24,7 @@ namespace bmh {
|
||||
struct TransferOfferListView;
|
||||
struct TransferDecisionEvent;
|
||||
struct HumanBuyerSaleHooks;
|
||||
struct GameState;
|
||||
|
||||
// Special team id used by the original for "no club" / the player pool (0x165).
|
||||
constexpr int kNoTeam = 0x165;
|
||||
@@ -35,7 +36,19 @@ constexpr int kNoTeam = 0x165;
|
||||
constexpr uint16_t kEmptySlot = 0x0FFF;
|
||||
constexpr uint16_t kSlotInLineup = 0x8000;
|
||||
|
||||
// Season functions the shared match core calls back into. Classic leaves the pointer in
|
||||
// GameState empty and the core calls its own season functions; the Modern season core
|
||||
// (src/modern) installs its versions, so one match core serves both season cores.
|
||||
struct SeasonHooks {
|
||||
void (*player_statistic)(GameState& g, int competition_type, int player, int manager, int slot, int kind,
|
||||
int minute) = nullptr;
|
||||
int (*table_prediction)(GameState& g, int team, int mode, std::array<uint8_t, 24>& buf,
|
||||
int* size_word) = nullptr;
|
||||
};
|
||||
|
||||
struct GameState {
|
||||
// Season core callbacks for the shared match core; nullptr = Classic (see SeasonHooks).
|
||||
const SeasonHooks* season_hooks = nullptr;
|
||||
std::vector<uint16_t> squad_slots; // *SquadSlots, all squads back to back (see squad_range)
|
||||
std::vector<Player> players; // *PlayerConditionTechniqueForm / *PlayerSkillWords / *PlayerIdentityWords, names not filled
|
||||
std::vector<uint8_t> team_morale; // *TeamMorale, per team: bits 0-5 morale / 2, bits 6-7 flags
|
||||
|
||||
Reference in new issue
Block a user