Files
Dreierpack-Manager/src/game/long_career.hpp
T
ClaudeandClaude Sonnet 5.5 287b5a9251 Add header comments to the source files
Every source file in ui, app, game, formats, cli, audio and launch that had none
now starts with a short English comment: what it implements, what state it owns
and how it relates to its neighbours (request/acknowledge flow, pairs of files,
random generator use). Comment lines only; the full build and the runnable
tests are unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-06 09:15:23 +01:00

35 lines
1.5 KiB
C++

// SPDX-License-Identifier: GPL-3.0-only
// Interface of the long-career extension block (extension id, statistics and title history
// archive types, record/reset/swap functions and encode/decode) implemented in long_career.cpp.
// No random numbers are drawn.
#pragma once
#include <array>
#include <cstdint>
#include <map>
#include <string>
#include "formats/binary.hpp"
namespace bmh {
struct GameState;
struct PlayerClubStatistics {
std::array<uint64_t, 3> appearances{};
uint64_t total = 0, goals = 0, assists = 0;
bool operator==(const PlayerClubStatistics&) const = default;
};
// Optional OBMHEXT1 block, outside the Original guest address space. Payload v1.
inline constexpr uint32_t kLongCareerExtension = 0x4f424c43;
using PlayerStatisticsArchive = std::map<uint32_t, PlayerClubStatistics>;
using TitleHistoryArchive = std::map<uint32_t, std::array<std::string, 9>>;
PlayerClubStatistics player_club_statistics(const GameState&, int team, int player,
const std::array<uint8_t, 0x58>& board);
void record_player_statistics(GameState&, int manager, int row, int player, int competition_class, int kind);
void reset_player_statistics(GameState&, int manager, int player);
void swap_statistics_clubs(GameState&, int first, int second);
TitleHistoryArchive title_history_rows(const GameState&);
void capture_title_history(GameState&);
void record_title_holder(GameState&, int category, uint16_t winner);
void shift_legacy_title_history(GameState&);
Bytes encode_long_career(const GameState&);
void decode_long_career(GameState&, const Bytes&);
}