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>
This commit is contained in:
1 parent
aa6ec96305
commit
287b5a9251
324 files changed
+1186
No files matched your search
@@ -1,4 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Business plan (balance plan) screen of a human manager: builds a draft of the plan rows
|
||||
// (income, running costs, shares and loans, catering, ticket price), checks per-row maxima when
|
||||
// the player edits a row and writes the accepted plan back on close.
|
||||
// Reads and writes the manager records in GameState (manager_records); reads schedule, table and
|
||||
// prediction data for the forecast. Draws no random numbers.
|
||||
// Interface in balance_plan.hpp; monthly bookings of similar figures live in month.cpp / week.cpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/environment.hpp"
|
||||
#include "game/balance_plan.hpp"
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Bank credit dialog: loans from the bank or from another manager, held in the per-manager loan
|
||||
// matrix of the manager records. Implements the amount/fee/monthly-payment arithmetic (with the
|
||||
// original's extended-precision rounding emulated in integers), draft editing with bounds, and
|
||||
// the interest-rate change. Reads the manager records and executable tables via BankCreditContext;
|
||||
// only change_bank_credit_interest writes GameState here. Draws no random numbers.
|
||||
// Types are declared in bank_credit.hpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/bank_credit.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Interface of the bank credit dialog: context (rate table, liquidity, saved loan row), draft,
|
||||
// edit and bounds types plus the projection/edit functions implemented in bank_credit.cpp.
|
||||
// Case "bank" and case "another manager lends" share these types; projection and draft editing
|
||||
// are read-only with respect to GameState. No random numbers are drawn.
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Per-manager guard against repeated bank robbery events: one blocked month key per manager,
|
||||
// stored in an OpenBMH-owned extension block of the static memory in GameState (not in the
|
||||
// original save fields). The month key function is implemented in week.cpp.
|
||||
// Header-only accessors; no random numbers are drawn.
|
||||
#pragma once
|
||||
#include "game/state.hpp"
|
||||
#include <limits>
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Calendar epoch (start year and weekday of the season calendar), read from the date setup code
|
||||
// of the loaded executable image. Unknown or unverified setups are rejected with FormatError.
|
||||
// Holds one process-wide installed epoch; reads no GameState and draws no random numbers.
|
||||
// Declared in calendar.hpp.
|
||||
#include "game/calendar.hpp"
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "formats/le.hpp"
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Interface for the calendar epoch (start year and weekday) used for date calculations.
|
||||
// calendar_epoch_from_executable validates the loaded executable, install_calendar_rules makes it
|
||||
// active, calendar_epoch returns it (a synthetic default for isolated test states).
|
||||
// Implemented in calendar.cpp; no GameState access and no random numbers.
|
||||
#pragma once
|
||||
namespace bmh {
|
||||
class LeImage;
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Start of a new career: league strength ranges read from the executable, generation of players
|
||||
// (startup squads, the extra and market players), initial club moods and markets, the starting
|
||||
// state built from the data files, plus new-manager setup (stadium, sponsors, competition blocks).
|
||||
// Writes most of GameState (players, squad_slots, memory, manager records).
|
||||
// Draws from both generators: WatcomRandom for attributes and levels, GameRandom for the
|
||||
// reseeding done by stir_random and the mood reset.
|
||||
// Interface in career.hpp; the season-wide steps follow in season.cpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/career.hpp"
|
||||
#include "game/lineup.hpp"
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Club information screen preparation: sets the line-up markers (first eleven / bench) in the
|
||||
// club's squad_slots, clears markers of injured players and applies the chosen player category.
|
||||
// Reads players and squad ranges, writes squad_slots in GameState. Draws no random numbers.
|
||||
// Interface in club_info.hpp; line-up rules themselves are in lineup.cpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/club_info.hpp"
|
||||
#include <stdexcept>
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Player detail screen opened from a club squad or the market pool: resolves the selection to a
|
||||
// squad slot, builds the context (loans, national nomination mode, pending offers) and runs the
|
||||
// actions the screen offers (market value, add to national squad, offers).
|
||||
// Reads and writes players, squad_slots and manager data in GameState.
|
||||
// Draws from WatcomRandom (market value, adding to a squad) and reseeds both generators via
|
||||
// stir_random. Interface in club_player_detail.hpp; related code in national.cpp and weekly.cpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/club_player_detail.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Interface of the player detail screen: selection and context types (squad vs market pool row,
|
||||
// loan data, national mode) and the functions implemented in club_player_detail.cpp.
|
||||
// Context building is read-only; actions take both generators (GameRandom, WatcomRandom) and
|
||||
// a MinuteReport, as documented at each declaration below.
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Cup competitions: Masters qualification, replay lists, group tables and qualifiers, friendly
|
||||
// preparation, national tournament end and the draw/advance step advance_cup for each round.
|
||||
// Works on the cup entries in the static memory of GameState and on MatchGroup results.
|
||||
// Draws from WatcomRandom (tie ordering) and GameRandom (shuffling the Masters field).
|
||||
// Interface in cup.hpp; matchday_setup.cpp creates the matches, driver.cpp and season.cpp are neighbours.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/cup.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Entering a human manager's desk: desk button table per game mode, the random stir, the table
|
||||
// prediction messages, the autosave hook and the manager's prestige (weighted sum of ratings and
|
||||
// money). Reads and writes manager records and the mailbox in GameState.
|
||||
// Draws from WatcomRandom (the four save draws) and reseeds both generators via stir_random.
|
||||
// Interface in desk.hpp; called from turn.cpp before each desk.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/desk.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Interface for entering a human manager's desk (the part before the desk screen appears):
|
||||
// enter_desk, the draws made when saving, and the prestige update.
|
||||
// Implemented in desk.cpp; uses both generators (GameRandom, WatcomRandom) as documented below.
|
||||
#pragma once
|
||||
// Entering a human manager's desk (DeskDate, the part before the desk screen).
|
||||
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Actions a human manager can take at the desk: friendly match quotes and booking (including
|
||||
// the national team variant), training camp configuration, and the transfer offer editor
|
||||
// with bids and market previews.
|
||||
// Reads and writes manager records, memory (friendly plan, calendar), players and squad_slots.
|
||||
// Quotes draw from WatcomRandom on a staged copy that is committed only when accepted; booking
|
||||
// also handles GameRandom. Interface in desk_actions.hpp; bids are settled in weekly.cpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/desk_actions.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Match day driver: plays the minutes of all match groups of a matchday in phases (first half,
|
||||
// second half, extra phases), shows or hides screens per button table and handles the phase end
|
||||
// (cup tie decisions, results, reseeding via stir_random).
|
||||
// Works on MatchGroup lists, GameState and the MatchEngine of match_engine.cpp.
|
||||
// Passes both generators on to the engine; itself only reseeds them at phase end.
|
||||
// Interface in driver.hpp; neighbours are matchday_setup.cpp and season.cpp.
|
||||
#include "game/driver.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Club environment budgets of a human manager (youth teams, academy, co-trainer, doctor,
|
||||
// physiotherapist): monthly cost per level, setting a level, and the youth team results and
|
||||
// season handover. Reads and writes the budget and youth blocks in the static memory of GameState.
|
||||
// advance_youth_teams draws from WatcomRandom; setting levels draws nothing.
|
||||
// Interface in environment.hpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/environment.hpp"
|
||||
#include <algorithm>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Interface for the club environment budgets (youth teams, academy, co-trainer, doctor,
|
||||
// physiotherapist): item enum, monthly cost steps, state view and the functions implemented in
|
||||
// environment.cpp. Setting a level draws no random number; youth match results use WatcomRandom.
|
||||
#pragma once
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// High-score table of the game: computes a manager's score from his record (assets, history,
|
||||
// titles), builds projections of the ranked table and reads/writes the five-row score file bytes.
|
||||
// Reads manager records in GameState; the file images are passed in and out as bytes.
|
||||
// Draws no random numbers. Interface in highscore.hpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/highscore.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Interface of the high-score table: row/table/projection types and the scoring and file
|
||||
// functions implemented in highscore.cpp. Names keep the original text encoding.
|
||||
// Reads GameState only; no random numbers are drawn.
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Types for completing the sale of a player to a human buyer (allocator gate, direct mode,
|
||||
// result status). The unsaved observations named here are supplied by the caller; missing
|
||||
// evidence means "unsupported", never an implicit default.
|
||||
// The matching settle_human_buyer_sale function is implemented in weekly.cpp and takes WatcomRandom.
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// League pairings screen: the fixture view of a league round (filtered, postponed and per team),
|
||||
// paging preferences and the computer tip (predicted results) for the shown round.
|
||||
// Reads and writes GameState (memory preferences, squad data) through the screen owner struct.
|
||||
// Computer tips use the game generator; closing the screen reseeds both generators via
|
||||
// stir_random. Interface in league_pairings.hpp; the tip arithmetic is shared with source_tip.cpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/league_pairings.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Interface of the league pairings screen: constants, owner state, tip result and view types
|
||||
// and the open/move/close functions implemented in league_pairings.cpp. No mutator here calls a
|
||||
// presenter, advances a day or saves; generators are passed in by the caller where needed.
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Line-up rules: position types per formation depth, player suitability values, automatic
|
||||
// line-up for computer teams and the optimizer for human boards, plus preparing the line-up
|
||||
// entry of a team. Reads players, formations and tactics boards; writes squad_slots and boards.
|
||||
// Draws from WatcomRandom in two places of the automatic selection (see the rand calls below).
|
||||
// Interface in lineup.hpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/lineup.hpp"
|
||||
#include "formats/le.hpp"
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Long-career extension: per-club player statistics (appearances, goals, assists) and title
|
||||
// history archives kept in an OpenBMH extension block outside the original save fields, with
|
||||
// encoding to and decoding from bytes for saving.
|
||||
// Reads and writes GameState (memory extension, manager records). Draws no random numbers.
|
||||
// Interface in long_career.hpp.
|
||||
#include "game/long_career.hpp"
|
||||
#include "game/state.hpp"
|
||||
#include "formats/executable_layout.hpp"
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
// 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>
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Per-match environment values of the match engine: weather and temperature by month and region,
|
||||
// crowd bonus for the home side, and the start-of-match tactics choice for computer teams.
|
||||
// Reads GameState (clubs, month, spectators); the match state is filled by the caller.
|
||||
// Draws from WatcomRandom (weather, crowd, substitution mode); the minute simulation itself is
|
||||
// match_engine.cpp. Interface in match.hpp.
|
||||
#include "game/match.hpp"
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Minute-by-minute match simulation: chances and goals, shooter/assistant/taker picking,
|
||||
// fouls, cards, injuries, substitutions and tactics changes, producing a MinuteReport per minute.
|
||||
// Reads and writes the match state in GameState and the MatchGroup fixtures it was built with.
|
||||
// Draws from both generators (WatcomRandom and GameRandom); the draw counts are compared with
|
||||
// recordings in regression tests.
|
||||
// MatchEngine is declared in match_engine.hpp; driver.cpp calls it.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/match_engine.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Matchday processing shared by all competitions: match results into club tables, cards and
|
||||
// statistics, bonus payments, morale and player development after a match, league screens
|
||||
// and rating of the manager, plus stir_random (reseeding both generators).
|
||||
// Reads and writes GameState (players, tables, manager records, memory).
|
||||
// Draws from GameRandom and WatcomRandom as named at each use below.
|
||||
// Interface in matchday.hpp; the matches are set up in matchday_setup.cpp and played in driver.cpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/environment.hpp"
|
||||
#include "game/matchday.hpp"
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Matchday setup: builds the match groups of a calendar day (descriptors, teams, weather,
|
||||
// attendance and catering income, winter postponements, indoor tournament, live match choice,
|
||||
// kick-off) and the football pools coupon.
|
||||
// Reads and writes GameState (memory descriptors, squad_slots, manager records).
|
||||
// Draws heavily from WatcomRandom and also from GameRandom (see the calls below).
|
||||
// Interface in matchday_setup.hpp; results are handled in matchday.cpp and driver.cpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/matchday_setup.hpp"
|
||||
#include "game/trace.hpp"
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Mailbox and text helpers: posting messages to managers, looking up message texts and
|
||||
// formatting numbers with the original's flag conventions.
|
||||
// Reads and writes the mailbox of GameState and reads the text tables installed from the
|
||||
// executable. Draws no random numbers. Interface in messages.hpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/messages.hpp"
|
||||
#include "game/schedule.hpp"
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Monthly processing: new transfer list entries and free agents, return of loans, monthly expenses
|
||||
// and income, shares and loans, market value and contract demands/offers/bonuses, and the
|
||||
// month change itself.
|
||||
// Reads and writes GameState (transfer list in memory, squad_slots, players, manager records).
|
||||
// Draws from WatcomRandom (list generation, demands); no GameRandom draws are made here.
|
||||
// Interface in month.hpp; called from turn.cpp, weekly steps are in weekly.cpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/environment.hpp"
|
||||
#include "game/month.hpp"
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// National team: nomination of players, swapping the national coach record into the spare
|
||||
// manager slot on international days, adding players to a squad and creating board entries.
|
||||
// Reads and writes GameState (manager records, tactics boards, squad_slots, static bytes).
|
||||
// Draws from WatcomRandom when creating board entries and values. Interface in national.hpp;
|
||||
// called from turn.cpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/national.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// "Other games" desk view: rows of the results and fixtures of a competition round (group or
|
||||
// knockout), linked pages and club metadata for display. A read-only projection of GameState
|
||||
// and the loaded texts; the parameter named game is the GameState, not a random generator.
|
||||
// Draws no random numbers. Interface in other_games.hpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/other_games.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Interface of the "other games" view: row, club metadata and page types and the const
|
||||
// projection functions implemented in other_games.cpp. Read-only; no random numbers are drawn.
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Types for answering pending transfer offers manually (yes / no / unsupported answers, the
|
||||
// question and dispatch context, allocator gate). Absence of an answer never means "no".
|
||||
// Declarations only; the generators are passed in by the caller as shown below.
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Poaching a player from another club: asking percentage of the club, remaining attempts per
|
||||
// manager and the start and finish of a poach attempt.
|
||||
// Reads and writes GameState (manager records attempt list, transfer list in memory, squad_slots).
|
||||
// Draws from WatcomRandom. Interface in poach.hpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/poach.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Table prediction and season bonus: predicted final league position of a team, the season
|
||||
// bonus paid to a manager and the expected bonus for players.
|
||||
// Reads GameState (tables, tactics boards, manager records); season_bonus can book the payment.
|
||||
// Draws no random numbers. Interface in prediction.hpp; included by desk.cpp and balance_plan.cpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/prediction.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Player and team ratings: player_value weighs selected attributes (condition, technique,
|
||||
// skills, form) and team_rating adds corrections for human managers' players and per-position terms.
|
||||
// Reads players and tactics boards in GameState; the generators come from the RatingContext.
|
||||
// Draws from WatcomRandom through that context in the human-board corrections and for teams
|
||||
// without squads. Interface in rating.hpp.
|
||||
#include "game/rating.hpp"
|
||||
|
||||
#include <array>
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Reality scene, ball decisions: shot or pass choice and scoring, blockers on a path, duel and
|
||||
// dribble outcomes and applying the result to the scene.
|
||||
// Reads GameState (players, tactics) and the RealitySetup; mutates the owned scene structures.
|
||||
// Draws from WatcomRandom (and takes GameRandom as a parameter). Interface in reality_ball.hpp;
|
||||
// driven by reality_scene.cpp.
|
||||
#include "game/reality_ball.hpp"
|
||||
#include "game/reality_duel.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Interface of the Reality scene ball logic: ball history, decision and outcome types and the
|
||||
// decide/apply functions implemented in reality_ball.cpp. The functions take WatcomRandom (and
|
||||
// GameRandom where declared).
|
||||
#pragma once
|
||||
|
||||
#include "game/rating.hpp"
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Reality scene, fouls and duels: decides whether a duel ends in a foul, whistle, card or
|
||||
// injury, and the follow-up steps of the scene. Executes the forced event callback supplied by the
|
||||
// caller instead of substituting a default.
|
||||
// Reads GameState and the RealitySetup; draws from WatcomRandom. Interface in reality_duel.hpp.
|
||||
#include "game/reality_duel.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Interface of the Reality scene foul/duel logic: forced-event and sound callbacks, foul cue and
|
||||
// result types, implemented in reality_duel.cpp. Draws use WatcomRandom as declared below.
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Bridge between one real match of the match engine and the Reality scene: validates that the
|
||||
// engine, generators and fixture still own the scene, advances the scene and settles deferred
|
||||
// substitution requests when it ends.
|
||||
// Works on the MatchEngine state and its two generators; the draws are made by the scene code
|
||||
// it calls (reality_scene.cpp). Interface in reality_match.hpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/reality_match.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Interface of the Reality match bridge: deferred request and RealityMatchScene types and the
|
||||
// settle function implemented in reality_match.cpp. Requests survive scene end and run later.
|
||||
#pragma once
|
||||
|
||||
#include "game/match_engine.hpp"
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Reality scene geometry and motion: direction quantisation on the pitch grid, projection to
|
||||
// screen positions from the executable's tables, per-figure motion, paths and grid placement.
|
||||
// Independent of GameState and draws no random numbers. Interface in reality_motion.hpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/reality_motion.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Interface of the Reality scene motion layer: figure motion and path types, grid and the
|
||||
// functions of reality_motion.cpp. Deliberately independent of GameState and both generators.
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Reality scene, player movement: speed of a figure, movement context for the ball decision,
|
||||
// attacker and defender moves and the defensive push.
|
||||
// Reads GameState (players) and the RealitySetup; draws from WatcomRandom.
|
||||
// Interface in reality_movement.hpp; driven by reality_scene.cpp.
|
||||
#include "game/reality_movement.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Interface of the Reality scene movement layer: per-iteration move context and the attacker/
|
||||
// defender move functions implemented in reality_movement.cpp (WatcomRandom as declared below).
|
||||
#pragma once
|
||||
|
||||
#include "game/reality_space.hpp"
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Reality scene, live reporter text: parses the reporter text templates (selectable variants
|
||||
// and nested expressions) and evaluates them into commentary lines for the current action.
|
||||
// Parsing draws nothing; evaluation draws from WatcomRandom.
|
||||
// Reads the RealitySetup and executable text pools. Interface in reality_reporter.hpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/reality_reporter.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Interface of the Reality reporter: frame and state types and the initialise/report functions
|
||||
// implemented in reality_reporter.cpp. The scene owner supplies the frame values.
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Reality scene control loop: creates a scene from a fixture, advances it tick by tick
|
||||
// (ball decision, reporter, movement of attackers and defenders), detects stop conditions
|
||||
// (goal mouth, shot, boundary, forced event, user exit) and finishes it.
|
||||
// Reads GameState and the RealitySetup; draws from WatcomRandom and passes both generators on to
|
||||
// its parts. Interface in reality_scene.hpp; builds on reality_ball.cpp, reality_movement.cpp,
|
||||
// reality_duel.cpp and reality_reporter.cpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/reality_scene.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Interface of the Reality scene: caller-owned context, stop reasons, scene, result and tick
|
||||
// types and the create/advance/exit functions implemented in reality_scene.cpp.
|
||||
#pragma once
|
||||
|
||||
#include "game/reality_duel.hpp"
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Reality scene setup: finds the manager of a team, derives the formations on the pitch grid and
|
||||
// places the players of both teams with their positions, card values and movement limits.
|
||||
// Reads GameState (tactics, formations, players). The setup function takes both generators as
|
||||
// parameters. Interface in reality_setup.hpp; used by reality_scene.cpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/reality_setup.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Interface of the Reality scene setup: formations, placement and RealitySetup types and the
|
||||
// functions implemented in reality_setup.cpp.
|
||||
#pragma once
|
||||
|
||||
#include "game/reality_motion.hpp"
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Reality scene spatial decisions: paths in the penalty box, whether a cell is on a path,
|
||||
// offside, nearby players and penalty area occupancy, with side and bounds validation.
|
||||
// Reads the RealitySetup; sampling among line occupants uses WatcomRandom, not GameRandom.
|
||||
// Interface in reality_space.hpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/reality_space.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Interface of the Reality scene spatial helpers (path, offside, nearby, penalty area, line
|
||||
// occupants) implemented in reality_space.cpp.
|
||||
#pragma once
|
||||
|
||||
#include "game/reality_setup.hpp"
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Rescheduling a home league match of a human manager on the calendar screen: which days are
|
||||
// offered, conflicts with the friendly plan and replays, and moving the match.
|
||||
// Reads and writes the competition calendar, postponed list and friendly plan in the static
|
||||
// memory of GameState. Draws no random numbers. Interface in reschedule.hpp; uses schedule.cpp
|
||||
// and matchday_setup.hpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/reschedule.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Savegame writing: serialises GameState into the save file layout (header, stream, date text,
|
||||
// check bytes) and builds the Savegame record.
|
||||
// Reads GameState; make_savegame draws from WatcomRandom (savegame id and two bytes), the same
|
||||
// draws counted by save_game_draws in desk.cpp. Interface in save.hpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/save.hpp"
|
||||
#include "game/bank_robbery.hpp"
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// League scheduling: fixture round tables per league size installed from the loaded
|
||||
// executable, league sizes and calendar groups, team to league mapping and generation of the
|
||||
// fixtures of a matchday.
|
||||
// Process-wide tables, no GameState writes and no random numbers. Interface in schedule.hpp;
|
||||
// used by table_forecast.cpp, reschedule.cpp and others.
|
||||
#include "game/schedule.hpp"
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "formats/le.hpp"
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Season-wide steps: offers, club moods and balances, European qualification and cup fields,
|
||||
// annual accounts and profit tax, season awards, promotion/relegation, league shuffling, player
|
||||
// regeneration and release, and the first-season setup of a career.
|
||||
// Reads and writes most of GameState (memory, players, squad_slots, manager records).
|
||||
// Draws from WatcomRandom and GameRandom (see the calls below). Interface in season.hpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/environment.hpp"
|
||||
#include "game/season.hpp"
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Score arithmetic of the computer's league table forecast tip: from team ratings and secondary
|
||||
// values it produces one predicted result using the game generator.
|
||||
// A pure function of its arguments; each call consumes a fixed pattern of GameRandom draws.
|
||||
// Interface in source_tip.hpp; used by table_forecast.cpp.
|
||||
#include "game/source_tip.hpp"
|
||||
|
||||
#include <bit>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Interface of the computer tip score function implemented in source_tip.cpp. It consumes
|
||||
// GameRandom draws, including the final goal-cap draw, and touches no GameState.
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Sportschau (TV sports show) support: the matchday intro view built from the match groups
|
||||
// and the competition title of a group.
|
||||
// Read-only projection of GameState and the groups. Draws no random numbers.
|
||||
// Declared in sportschau_presentation.hpp; sportschau_rating.cpp and sportschau_replay.cpp are siblings.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/sportschau_presentation.hpp"
|
||||
#include <algorithm>
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Sportschau ratings: reads the rating tables from the executable and derives the player ratings
|
||||
// of a match group from the logged events of a fixture.
|
||||
// Reads the fixture view and writes ratings into the MatchGroup; draws from WatcomRandom
|
||||
// (score offsets). Declared in sportschau_presentation.hpp; siblings are sportschau_awards.cpp
|
||||
// and sportschau_replay.cpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/sportschau_presentation.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Sportschau replay: converts the logged events of a fixture into the timed steps of the report
|
||||
// and re-runs a fixture with a MatchEngine on a copy of the state for the replay.
|
||||
// The engine takes the caller's GameRandom and WatcomRandom. Declared in
|
||||
// sportschau_presentation.hpp; siblings are sportschau_awards.cpp and sportschau_rating.cpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/sportschau_presentation.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Stadium block expansion (blocks A-H): reads the edition's price/duration/limit constants,
|
||||
// quotes an expansion bound to the record values it depends on, and commits the construction
|
||||
// order and payment.
|
||||
// Reads and writes the manager records in GameState; the commit path takes WatcomRandom and a
|
||||
// notice hook for the payment. Interface in stadium_blocks.hpp.
|
||||
#include "game/stadium_blocks.hpp"
|
||||
|
||||
#include "game/matchday.hpp"
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Interface of the stadium block expansion: slots A-H, constants, immutable quote and the
|
||||
// quote/commit functions implemented in stadium_blocks.cpp. Block slots are distinct from the
|
||||
// stadium facilities used by the business plan.
|
||||
#pragma once
|
||||
|
||||
#include "game/desk_actions.hpp"
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// GameState construction and accessors: building the state from a loaded save and the database
|
||||
// counts, manager of a team, club and player names, formation and formation positions.
|
||||
// Squad table layout constants are defined here. Draws no random numbers.
|
||||
// Interface in state.hpp; every other file in this directory works on GameState.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/state.hpp"
|
||||
#include "game/bank_robbery.hpp"
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// League table computation: adding results with win bonus, sort keys and sorting, and
|
||||
// compute_league_table over a range of matchdays for a league.
|
||||
// Reads GameState (fixtures and results); returns a LeagueTable. Draws no random numbers.
|
||||
// Interface in table.hpp.
|
||||
#include "game/table.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Table screen forecast: combines the played table with predicted results of the remaining
|
||||
// matchdays (computer tips from source_tip.cpp) into a league table projection.
|
||||
// Reads GameState; works on a copy of the game generator and returns it in the result, so
|
||||
// callers commit it only with the accepted transition. Interface in table_forecast.hpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/table_forecast.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Interface of the table forecast: the LeagueTableForecast result (table plus the game generator
|
||||
// state after all draws) and compute_league_table_forecast, implemented in table_forecast.cpp.
|
||||
// Never changes the native results or the current matchday.
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Top scorers view: ranks players of a league or of the human managers by goals, assists or
|
||||
// scorer score and determines the owning manager of each club.
|
||||
// Read-only projection of GameState; invalid input throws FormatError. Draws no random numbers.
|
||||
// Interface in top_scorers.hpp.
|
||||
#include "game/top_scorers.hpp"
|
||||
|
||||
#include <array>
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Interface of the top scorers view: metric and scope enums, row type and the ranking function
|
||||
// implemented in top_scorers.cpp. Read-only; no random numbers are drawn.
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Request/result types for rating a transfer bid (source slot, list entry and ownership are
|
||||
// supplied by the caller, which owns the career-mode decisions).
|
||||
// Header only; the functions that use these types take WatcomRandom and a MinuteReport as shown below.
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Day-by-day turn processing: plain days, empty event days, month step, stock market day,
|
||||
// season end day and the preparation and finish of an event with its desk.
|
||||
// Reads and writes GameState and calls into month.cpp, weekly.cpp, week.cpp, season.cpp and the
|
||||
// matchday code. Takes both generators (GameRandom, WatcomRandom) and reseeds via stir_random at
|
||||
// league screens. Interface in turn.hpp; the calendar loop around it is in turn_driver.cpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/turn.hpp"
|
||||
#include "game/trace.hpp"
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Turn driver: walks the calendar day by day to the next desk, starts event passes, runs the
|
||||
// current matchday through the MatchEngine and reports audio events and desk results.
|
||||
// Reads and writes GameState and the TurnDriver state; passes GameRandom and WatcomRandom to
|
||||
// everything it calls (setup, matches, daily interest). Interface in turn_driver.hpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/turn_driver.hpp"
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Interface of the turn driver: audio event, desk kind, advance request/result and result
|
||||
// snapshot types and the TurnDriver runtime state kept between a desk and the next one.
|
||||
// The caller owns the generators; implemented in turn_driver.cpp.
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Daily and weekly bookkeeping: daily interest on balances, player training and attribute
|
||||
// changes, familiarity decay, auto training, the stock market and the bank robbery month key.
|
||||
// Reads and writes GameState (manager records, players, memory).
|
||||
// Draws from WatcomRandom (daily interest, familiarity, training) and GameRandom (training).
|
||||
// Interface in week.hpp; larger weekly steps are in weekly.cpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/week.hpp"
|
||||
#include "game/calendar.hpp"
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
// Weekly processing: manager offers, season ticket compensation, facility ageing and damage,
|
||||
// club attraction, advertising, transfer bids and offers (evaluate, execute, pending offers,
|
||||
// human buyer sale) and the transfer list countdown.
|
||||
// Reads and writes most of GameState (transfer list, squad_slots, players, manager records).
|
||||
// Draws heavily from WatcomRandom and also from GameRandom.
|
||||
// Interface in weekly.hpp; monthly steps are in month.cpp, daily ones in week.cpp.
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "game/weekly.hpp"
|
||||
#include "game/desk_actions.hpp"
|
||||
|
||||
Reference in new issue
Block a user