55 explicit Game(std::shared_ptr<class GameData> gd,
56 std::shared_ptr<DatabaseConnection> conn);
66 uint8_t home_score, uint8_t away_score);
78 std::span<const PlayerMatchConsequence> consequences = {});
83 std::optional<GameDateValue> date = std::nullopt)
const;
102 std::optional<GameDateValue> date = std::nullopt);
267 const std::map<
LeagueID, std::vector<StandingRow>>& final_tables,
268 std::uint16_t start_year);
270 void judgeSeason(std::span<const SeasonHistoryEntry> finished);
288 bool recall_regulars)
const;
297 bool include_managed =
false);
Manages the match calendar for a season.
Definition calendar.h:133
Per-career state of the guidance features: first-week checklist, delegation policy,...
Definition guidance.h:32
DelegationPolicy delegation
Definition guidance.h:38
Owns the result pipeline of all competitions.
Definition competition_manager.h:40
bool delegated(Duty duty) const
Definition delegation.h:70
bool set(Duty duty, DutyOwner owner)
Definition delegation.cpp:66
Represents the core game state and logic.
Definition game.h:48
bool getAssistantFixesLineup() const
Definition game.h:121
bool canKickOff(TeamID team_id, MatchType type) const
Definition game.cpp:579
ManagerCareer & getCareer()
Definition game.h:178
Calendar calendar
Definition game.h:313
std::vector< std::pair< PlayerID, PlayerID > > previewMatchdaySquadFix(TeamID team_id, MatchType type) const
Definition game.cpp:568
const CareerDayEvents & getLastCareerEvents() const
Definition game.h:181
NationalDayEvents last_national_events
Definition game.h:321
uint16_t getManagedTeamId() const
Retrieves the ID of the team currently managed by the user.
Definition game.cpp:760
std::size_t fixMatchdaySquad(TeamID team_id, MatchType type, std::optional< GameDateValue > date=std::nullopt)
Definition game.cpp:559
void startNewSeason()
Definition game.cpp:740
WorldSimulation world
Definition game.h:315
TransferMarket & getTransfers()
Definition game.h:174
SeasonArchive season_archive
Definition game.h:329
void advanceDay()
Advances the game time by one day, simulating any matches or events scheduled for the current date.
Definition game.cpp:287
const NationalTeams & getNationalTeams() const
Definition game.h:157
std::optional< SeasonReview > closing_review
Definition game.h:330
int youngRegulars(TeamID team_id) const
Definition game_season.cpp:32
bool setMatchResult(const GameDateValue &date, TeamID home_id, TeamID away_id, uint8_t home_score, uint8_t away_score)
Definition game.cpp:487
void takeJob(TeamID team_id, const ManagerContract &contract)
Definition game.cpp:791
SeasonArchive & getSeasonArchive()
Definition game.h:141
ManagerCareer career
Definition game.h:317
Supporters supporters
Definition game.h:328
NationalManagement & getNationalJob()
Definition game.h:161
CompetitionManager competitions
Definition game.h:314
void setSimulationThreads(unsigned threads)
Definition game.h:212
std::shared_ptr< class GameData > gamedata
Definition game.h:312
void finishSeasonReview()
Definition game_season.cpp:240
MatchScheduler scheduler
Definition game.h:322
NationalManagement national_job
Definition game.h:320
void postLineupRepairs()
Definition game_season.cpp:78
NationalTeams international
Definition game.h:319
std::vector< PlayerID > ineligibleSelections(TeamID team_id, MatchType type) const
Definition game.cpp:549
const GameDateValue & getCurrentDate() const
Retrieves the current in-game date.
Definition game.cpp:752
const SeasonArchive & getSeasonArchive() const
Definition game.h:140
const Calendar & getCalendar() const
Retrieves the calendar containing all fixtures.
Definition game.cpp:754
std::unique_ptr< RuntimeEditor::Extensions > extensions
Definition game.h:307
const Supporters & getSupporters() const
Definition game.h:134
const WorldSimulation & getWorld() const
Definition game.h:171
const CareerGuidance & getGuidance() const
Definition game.h:128
void resetSimulationProgress()
Definition game.h:210
void leaveManagedTeam(DepartureReason reason)
Definition game.cpp:769
uint16_t managed_team_id
Definition game.h:325
void setAssistantFixesLineup(bool enabled)
Definition game.h:116
uint8_t current_season
Definition game.h:324
void discoverExtensions()
Definition game.cpp:141
void saveGame()
Saves the current game state, including calendar and game variables, to the database.
Definition game.cpp:224
unsigned getSimulationThreads() const
Definition game.h:216
bool isEligible(const Player &player, MatchType type, std::optional< GameDateValue > date=std::nullopt) const
Definition game.cpp:540
void loadGame()
Definition game.cpp:168
void serialize(bool probe)
Definition game.cpp:226
TransferMarket transfers
Definition game.h:316
int extensions_version
Definition game.h:308
void setManagedTeamId(uint16_t id)
Sets the team managed by the user.
Definition game.cpp:762
MedicalDesk & getMedical()
Definition game.h:131
std::shared_ptr< DatabaseConnection > db_conn
Definition game.h:306
void fillLineupGap(Team &team, const Player &departed)
Definition game_season.cpp:63
const NationalManagement & getNationalJob() const
Definition game.h:162
void handleSeasonTransition()
Definition game.cpp:734
const MedicalDesk & getMedical() const
Definition game.h:132
void endSeason()
Definition game.cpp:666
std::vector< UpcomingFixture > upcomingFixtures(TeamID team_id) const
Definition game.cpp:833
std::vector< std::pair< std::string, std::string > > lineup_repairs
Definition game.h:332
const NationalDayEvents & getLastNationalEvents() const
Definition game.h:164
CareerDayEvents last_career_events
Definition game.h:318
CareerGuidance guidance
Definition game.h:326
void simulateMatches(std::vector< Match > &matches, bool include_managed=false)
Definition game.cpp:356
CupRun cupRun(TeamID team_id) const
Definition game_season.cpp:43
WorldSimulation & getWorld()
Definition game.h:170
SimulationProgress getSimulationProgress() const
Definition game.h:206
const CompetitionManager & getCompetitions() const
Definition game.h:137
std::size_t fillMatchdaySquad(Lineup &lineup, TeamID team_id, MatchType type, const GameDateValue &date, bool recall_regulars) const
Definition game.cpp:587
const ManagerCareer & getCareer() const
Definition game.h:179
const TransferMarket & getTransfers() const
Definition game.h:175
void settleLevelTie(Match &match, MatchReport &report)
Definition game.cpp:457
void beginSeasonReview(const std::map< LeagueID, std::vector< StandingRow > > &final_tables, std::uint16_t start_year)
Definition game_season.cpp:106
int getCurrentSeason() const
Retrieves the current season number.
Definition game.cpp:758
RuntimeEditor::Payloads payload_extensions
Definition game.h:309
NationalTeams & getNationalTeams()
Definition game.h:158
GameDateValue currentDate
Definition game.h:323
void runCareerDay()
Definition game.cpp:806
CareerGuidance & getGuidance()
Definition game.h:127
void judgeSeason(std::span< const SeasonHistoryEntry > finished)
Definition game_season.cpp:167
void keepManagedSelectionEligible()
Definition game.cpp:336
void recordCareerMatch(const Match &match)
Definition game.cpp:818
MedicalDesk medical
Definition game.h:327
Manages the starting XI and reserves of a team.
Definition lineup.h:85
The human manager's career and the market for managers.
Definition manager_career.h:415
Simulates a batch of independent matches in parallel.
Definition match_scheduler.h:115
void setThreadCount(unsigned thread_count)
Definition match_scheduler.cpp:119
void resetProgress()
Definition match_scheduler.h:130
SimulationProgress getProgress() const
Definition match_scheduler.h:136
unsigned getThreadCount() const
Definition match_scheduler.h:122
Represents a football match between two teams.
Definition match.h:38
The medical staff's day-to-day work for the managed club: rest and minute-limit instructions,...
Definition medical_centre.h:200
National-team jobs of the human manager: vacancies, applications and offers, the job itself (results,...
Definition national_job.h:160
National-team calendar, call-ups, matches and records.
Definition national_teams.h:212
Persistent career identity, attributes, traits and day-to-day state.
Definition player.h:104
Definition runtime_editor.h:142
Final league tables of past seasons and the managed club's season reviews (tables SeasonTables and Se...
Definition season_review.h:175
The managed club's supporters: their mood is recomputed once a week from the facts and nudges the boa...
Definition supporters.h:114
Represents a football team.
Definition team.h:47
Deals, loans, pre-contracts, payments and history of the market.
Definition transfer_market.h:221
Everything that happens between matches.
Definition world_simulation.h:104
const GameDateValue START_DATE(2025, 7, 2)
The starting date of the game.
DepartureReason
Why a spell in charge ended (values are persisted).
Definition manager_career.h:75
What changed during one simulated day.
Definition manager_career.h:302
Represents a specific date in the game world.
Definition gamedate.h:20
bool still_in
Definition game.h:152
bool won
Definition game.h:151
std::optional< int > rounds_left
Definition game.h:150
Terms of a manager's employment.
Definition manager_career.h:104
Structured summary of a played fixture, persisted per fixture.
Definition match_report.h:93
What changed on the latest simulated day.
Definition national_job.h:107
Definition match_scheduler.h:102
MatchType
Represents the type or category of a match.
Definition types.h:40
uint8_t LeagueID
Type alias for League identifiers.
Definition types.h:15
uint16_t TeamID
Type alias for Team identifiers.
Definition types.h:18