Files
Dreierpack-Manager/src/modern/game/club_player_detail.hpp
T
ClaudeandClaude Opus 5.5 f2fcb28f65 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>
2026-10-23 18:08:54 +02:00

50 lines
2.2 KiB
C++

// SPDX-License-Identifier: GPL-3.0-only
#pragma once
#include "game/club_player_detail.hpp"
#include <array>
#include <cstdint>
#include <optional>
#include <string>
#include "formats/le.hpp"
#include "game/random.hpp"
#include "modern/game/modern_state.hpp"
namespace bmh::modern {
// The list owns all row identities. A loan row has physical_row==-1 and its
// explicit Source Career_CareerManagersEnd_RuntimeField index. rendered_row is the visible list index, which
// may differ from a filtered/sorted market-pool entry.
// OpenTransferEditor passes actual slots CareerRuntimeField + entry (0..39) for ordinary
// transfer-market pool cards. It never turns the entry into a squad row.
constexpr int kClubPlayerDetailMarketPoolCount = 40;
// Resolves runtime club, explicit row and Source loan/national ownership without
// changing ModernState or either random generator. Invalid/stale identities throw.
ClubPlayerDetailContext club_player_detail_context(const ModernState&,
const ClubPlayerDetailSelection&);
// One actual ClubPlayerDetailFromGame card rebuild: Copy2/21213 portrait draws, followed
// by422ac/42307/PlayerCardMarketValue market valuation. Pure renderer calls consume this owned
// result repeatedly and never draw RNG. The caller passes Source heap gate.
ClubPlayerDetailRedraw club_player_detail_redraw(const ModernState&,
const ClubPlayerDetailSelection&,
const LeImage& original,
GameRandom&, WatcomRandom&,
bool portrait_available = true);
// ClubInfoFromGame temporarily uses (bbcde!=2), then restores its caller's value.
constexpr uint8_t club_player_detail_input_mode(uint8_t prior) { return prior != 2; }
// The actual Source nomination/remove button. Returns false if the national
// squad is full; the Source lineup refresh still follows the attempted add.
bool club_player_detail_national_action(ModernState&, const ClubPlayerDetailSelection&,
WatcomRandom&, MinuteReport&);
} // namespace bmh::modern