Player12
An open source football management simulator
Loading...
Searching...
No Matches
game_controller.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2// Football Management Project
3// Copyright (c) 2025 - 2026 Flavio Milinanni. All Rights Reserved.
4//
5// This file is part of the Football Management Project.
6// See the LICENSE file in the project root.
7// -----------------------------------------------------------------------------
8
9#pragma once
10
11#include <atomic>
12#include <chrono>
13#include <filesystem>
14#include <functional>
15#include <memory>
16#include <mutex>
17#include <optional>
18#include <random>
19#include <unordered_map>
20#include <vector>
21
24#include "global/stats_config.h"
25#include "model/competition.h"
26#include "model/game.h"
27#include "model/guidance.h"
28#include "model/league.h"
31#include "model/next_action.h"
32#include "model/player.h"
33#include "model/player_agent.h"
34#include "model/season_agenda.h"
35#include "model/squad_numbers.h"
36#include "model/squad_planner.h"
37#include "model/squad_status.h"
38#include "model/staff.h"
39#include "model/team.h"
40#include "model/training.h"
42#include "model/world_rng.h"
43#include "model/youth_academy.h"
44
45class MatchEngine;
46
48enum class ContinueStop : uint8_t
49{
50 None = 0,
51 Fixture,
52 Message,
53 Decision,
55 NewSeason,
56 LostJob,
57 Requested,
59};
60
70{
71 public:
73 {
74 uint32_t weekly_wage = 0;
75 uint8_t years = 0;
76 };
77
79 {
80 bool exists = false;
81 std::string team_name = "";
82 std::string game_date = "";
83 std::string real_date = "";
87 const char* status_key = "";
88 int season = 0;
89 std::int64_t playtime_seconds = 0;
92 std::string last_saved_game_date = "";
93 std::string last_saved_utc = "";
94 std::string game_version = "";
95 int backups = 0;
96 };
97
100 {
101 bool ok = true;
102 bool autosave = false;
105 std::string game_date;
107 };
108
113
119 void newGame(int slot,
120 std::optional<std::uint64_t> world_seed = std::nullopt);
121
126 bool loadGame(int slot);
127
132 const std::optional<SaveError>& getLastLoadError() const
133 {
134 return last_load_error;
135 }
136
138 std::optional<int> getCurrentSlot() const;
139
141 std::vector<SaveBackup> getSaveBackups(int slot) const;
142
148 bool restoreBackup(int slot, const std::filesystem::path& backup);
149
151 bool deleteSave(int slot) const;
152
154 void setAutosavePolicy(const AutosavePolicy& policy);
156
162
166 bool isGameLoaded() const;
167
172 int getCurrentSeason() const;
173
179
184 bool hasSelectedTeam() const;
185
190 std::optional<std::reference_wrapper<Team>> getManagedTeam();
191
196 std::optional<std::reference_wrapper<const Team>> getManagedTeam() const;
197
202 void selectManagedTeam(uint16_t team_id);
203
208 const std::vector<std::reference_wrapper<const League>>& getLeagues() const;
209
214 const std::vector<std::reference_wrapper<const Team>>& getTeams() const;
215
221 const std::vector<std::reference_wrapper<const Player>>& getPlayersForTeam(
222 uint16_t team_id) const;
223
229 SquadNumbers::Change setSquadNumber(PlayerID player_id, int number);
230
236 std::vector<std::reference_wrapper<const Team>> getTeamsInLeague(
237 uint8_t league_id) const;
238
244 std::optional<std::reference_wrapper<const League>> getLeagueById(
245 uint8_t league_id) const;
246
252 std::optional<std::reference_wrapper<const Team>> getTeamById(
253 uint16_t team_id) const;
254
261 const ClubIdentity* getClubIdentity(TeamID team_id) const;
262
267 const StatsConfig& getStatsConfig() const;
268
272 void advanceDay();
273
276 int advanceToNextManagedFixture(int max_days = 60);
277
279 static constexpr int OFF_SEASON_MAX_DAYS = 45;
288 int advanceToNextEvent(int max_days = OFF_SEASON_MAX_DAYS);
289
296 [[nodiscard]] bool isContinueStopRequested() const
297 {
299 }
303 static const char* continueStopKey(ContinueStop stop);
304
307 {
309 int days_done = 0;
310 int days_total = 0;
312 uint32_t matches_done = 0;
313 uint32_t matches_total = 0;
314
316 float fraction() const;
317 };
323
325 void setSimulationThreads(unsigned threads);
326
327 bool setMatchResult(GameDateValue date, uint16_t home_id, uint16_t away_id,
328 uint8_t home_score, uint8_t away_score);
329
334 bool setMatchResult(GameDateValue date, uint16_t home_id, uint16_t away_id,
335 const MatchEngine& engine);
336
340 std::optional<MatchRules::Knockout> getKnockoutRules(GameDateValue date,
341 TeamID home_id,
342 TeamID away_id) const;
343
345 std::vector<PlayerID> getIneligibleSelections(TeamID team_id,
346 MatchType type) const;
349 size_t autoFixLineup(TeamID team_id, MatchType type);
352 std::vector<std::pair<PlayerID, PlayerID>> previewLineupFix(
353 TeamID team_id, MatchType type) const;
357 bool canKickOff(TeamID team_id, MatchType type) const;
360 void setAssistantFixesLineup(bool enabled);
361 bool getAssistantFixesLineup() const;
362
363 // ========== Competitions ==========
365 std::vector<StandingRow> getStandings(LeagueID league_id) const;
367 std::vector<LeagueID> getCupIds() const;
368 std::optional<Competitions::CupStatus> getCupStatus(LeagueID cup_id) const;
369 std::string getCupName(LeagueID cup_id) const;
371 uint8_t getLeagueTier(LeagueID league_id) const;
373 std::vector<Match> getTeamFixtures(TeamID team_id) const;
374 std::optional<MatchReport> getMatchReport(GameDateValue date, TeamID home_id,
375 TeamID away_id) const;
376 const std::vector<SeasonHistoryEntry>& getSeasonHistory() const;
378 std::vector<uint16_t> getArchivedSeasons(LeagueID league_id) const;
380 const std::vector<StandingRow>* getArchivedTable(uint16_t season,
381 LeagueID league_id) const;
383 uint16_t getSeasonStartYear(uint16_t season) const;
385 std::optional<std::pair<LeagueID, uint16_t>> getArchivedPlacing(
386 uint16_t season, TeamID team_id) const;
388 const SeasonReview* getUnseenSeasonReview() const;
389 void markSeasonReviewSeen(uint16_t season);
390 std::vector<PlayerSeasonStats> getTopScorers(MatchType competition_type,
391 LeagueID competition_id,
392 size_t limit = 10) const;
393 std::vector<PlayerSeasonStats> getPlayerSeasonStats(PlayerID player_id) const;
394 std::vector<PlayerSeasonStats> getPlayerCareer(PlayerID player_id) const;
395
396 // ========== International ==========
401 LeagueID competition_id, const ContinentalCompetitions::Tie& tie) const;
404 const NationalTeams* getNationalTeams() const;
408 std::optional<Language> getInternationalDuty(PlayerID player_id) const;
410 uint8_t getSuspensionMatches(PlayerID player_id, MatchType scope) const;
412 std::vector<DisciplinaryRecord> getSuspendedPlayers(TeamID team_id) const;
413
422 bool saveGame();
423
426
431
432 // ========== Transfer Market: Listing ==========
433 void listPlayerForTransfer(PlayerID player_id, uint32_t asking_price);
434 void removePlayerFromTransfer(PlayerID player_id);
435 bool isPlayerListed(PlayerID player_id) const;
436
437 // ========== Transfer Market: Queries ==========
438 const std::unordered_map<PlayerID, TransferListing>& getAllListings() const;
439 std::vector<const TransferListing*> getListingsExcludingTeam(
440 TeamID team_id) const;
441 std::vector<const TransferListing*> getListingsByRole(PlayerRole role) const;
442
443 // ========== Transfer Market: Buying ==========
444 bool canAffordPlayer(TeamID buyer_id, PlayerID player_id,
445 uint32_t target_price) const;
446 bool canAffordPlayer(TeamID buyer_id, PlayerID player_id,
447 uint32_t target_price,
448 uint32_t offered_weekly_wage) const;
449 bool buyPlayer(PlayerID player_id, TeamID buyer_id, uint32_t price);
450 bool buyPlayerWithContract(PlayerID player_id, TeamID buyer_id,
451 uint32_t price, ContractTerms terms);
452 bool signFreeAgent(PlayerID player_id, TeamID buyer_id);
453 bool signFreeAgentWithContract(PlayerID player_id, TeamID buyer_id,
454 ContractTerms terms);
455 ContractTerms getContractDemand(PlayerID player_id, bool free_agent) const;
456 bool isContractOfferAcceptable(PlayerID player_id, bool free_agent,
457 ContractTerms terms) const;
458 uint32_t getPlayerMarketValue(PlayerID player_id) const;
459
460 // ========== Transfer Market: Bids & Negotiation ==========
461 bool submitBid(PlayerID player_id, TeamID bidder_id, uint32_t bid_amount);
462 bool acceptBid(PlayerID player_id);
463 bool rejectBid(PlayerID player_id);
464 bool counterOffer(PlayerID player_id, uint32_t new_price);
467 bool isTransferWindowOpen() const;
470 bool isTransferWindowOpenFor(TeamID club) const;
473 bool isTransferWindowOpenAnywhere() const;
476 bool canSignFreeAgentFor(TeamID club) const;
477
478 // ========== Transfer Market: structured deals ==========
488 PlayerID player_id, const TransferNegotiation::OfferTerms& terms);
491 std::optional<TransferNegotiation::ContractKind> getContractTalkKind(
492 PlayerID player_id) const;
496 PlayerID player_id, TransferNegotiation::ContractKind kind) const;
497
499 enum class PlayerActionBlock : std::uint8_t
500 {
501 None,
502 NotYours,
504 OnLoan,
505 Leaving,
506 SquadFloor,
508 MaxLength,
509 NotLonger,
510 TooLong,
511 TalksEnded,
512 SquadFull
513 };
515 static const char* playerActionBlockKey(PlayerActionBlock block);
519 PlayerActionBlock getSaleBlock(PlayerID player_id) const;
524
543 PlayerID player_id, const TransferNegotiation::ContractOffer& offer);
545 std::uint8_t getContractRoundsLeft(PlayerID player_id) const;
546
551 std::uint8_t years) const;
553 const char* getAgentOpeningLine(PlayerID player_id,
556 const char* getAgentPurchaseLine(
557 PlayerID player_id,
558 const TransferNegotiation::ClubResponse& response) const;
560 uint32_t getReleaseClause(PlayerID player_id) const;
567
570 PlayerID player_id, const TransferNegotiation::LoanTerms& terms);
572 bool setLoanListed(PlayerID player_id, bool listed);
575 bool recallLoan(PlayerID player_id);
577 bool canRecallLoan(PlayerID player_id) const;
579 bool hasSquadRoom() const;
581 bool exerciseLoanOption(PlayerID player_id);
582
585 const std::vector<IncomingOffer>& getIncomingOffers() const;
586
621 std::optional<IncomingOfferView> getIncomingOfferView(
622 std::uint32_t offer_id) const;
623
625 enum class OfferOutcome : std::uint8_t
626 {
627 Sold,
629 Countered,
630 WalkedAway,
631 Rejected,
634 Failed
635 };
638 OfferOutcome settleIncomingOffer(std::uint32_t offer_id);
640 bool acceptIncomingOffer(std::uint32_t offer_id);
642 bool rejectIncomingOffer(std::uint32_t offer_id);
646 std::uint32_t offer_id, const TransferNegotiation::OfferTerms& terms);
651 OfferOutcome counterLoanOffer(std::uint32_t offer_id,
652 const TransferNegotiation::LoanTerms& terms);
656 OfferOutcome nameAskingPrice(std::uint32_t offer_id, uint32_t price);
659 bool declareNotForSale(std::uint32_t offer_id);
660
662 int64_t getReleaseCost(PlayerID player_id) const;
664 bool releasePlayer(PlayerID player_id);
665
666 // ========== AI Helpers ==========
668 {
669 int missing_gk = 0;
670 int missing_cb = 0;
671 int missing_lb = 0;
672 int missing_rb = 0;
673 int missing_mid = 0;
675 int missing_st = 0;
676
677 int surplus_gk = 0;
678 int surplus_cb = 0;
679 int surplus_lb = 0;
680 int surplus_rb = 0;
681 int surplus_mid = 0;
683 int surplus_st = 0;
684
685 std::optional<PlayerRole>
686 upgrade_target; // Role that needs quality upgrade
687 };
688
689 SquadNeeds evaluateSquadNeeds(TeamID team_id) const;
690 float calculateAttentionScore(PlayerID player_id) const;
691 float getLeagueAttentionMultiplier(LeagueID league_id) const;
692 uint32_t calculateMaxPrice(PlayerID player_id, TeamID buyer_id,
693 const SquadNeeds& needs) const;
694 void evaluateAndActForTeam(TeamID team_id);
695 std::vector<PlayerID> findTargetsForRole(PlayerRole role, TeamID buyer_id,
696 const SquadNeeds& needs) const;
703 uint32_t transferBudgetForTeam(TeamID team_id) const;
704
705 float randomFloat(float min, float max)
706 {
708 }
709
710 // ========== World: inbox ==========
713 const std::vector<InboxMessage>& getInbox() const;
715 bool markInboxMessageRead(uint32_t message_id);
717 size_t getUnreadInboxCount() const;
719 InboxView getInboxView() const;
720 void setInboxView(const InboxView& view);
724 bool followPlayer(PlayerID player_id);
725 bool unfollowPlayer(PlayerID player_id);
726 bool isFollowingPlayer(PlayerID player_id) const;
727 std::vector<PlayerID> getFollowedPlayers() const;
729 std::optional<Dilemma> getOpenDilemma() const;
731 std::optional<DilemmaEffects> getDilemmaEffects(int option) const;
733 bool resolveDilemma(int option);
734
735 // ========== World: board ==========
737 const BoardState& getBoardState() const;
738
757 std::optional<BoardTargets> getBoardTargets() const;
758
765 bool isTransferEmbargoed() const;
766
767 // ========== World: finances ==========
769 const std::vector<FinanceTransaction>& getFinanceLedger(TeamID team_id) const;
772 GameDateValue to) const;
774 int64_t getWeeklyWageBill(TeamID team_id) const;
780 bool moveTransferToWageBudget(int64_t transfer_amount);
782 bool setTicketPrice(uint32_t price);
784 uint32_t getFairTicketPrice(TeamID team_id) const;
786 uint32_t getLastHomeAttendance(TeamID team_id) const;
787
788 // ========== World: players ==========
790 bool isPlayerAvailable(PlayerID player_id) const;
792 std::vector<PlayerID> getInjuredPlayers(TeamID team_id) const;
794 std::vector<PlayerID> getUnavailableLineupPlayers(TeamID team_id) const;
796 SquadRole getSquadRole(PlayerID player_id) const;
797
799 {
800 float low = 0.0f;
801 float high = 0.0f;
802 };
805
812 bool applyMatchConsequences(PlayerID player_id, uint8_t minutes_played,
813 float end_condition, bool injured);
814
818 bool renewContract(PlayerID player_id, ContractTerms terms);
819
820 // ========== Human side: conversations, team talks, dressing room ==========
825 float getManagerStanding() const;
828 std::vector<TalkOptionView> getTalkOptions(PlayerID player_id) const;
835 std::optional<TalkOutcome> talkToPlayer(PlayerID player_id,
836 TalkOption option);
838 const PlayerRelation* getPlayerRelation(PlayerID player_id) const;
840 std::vector<Promise> getPlayerPromises(PlayerID player_id) const;
842 std::vector<Promise> getActivePromises() const;
844 std::optional<StoryChoice> getStoryChoice(PlayerID player_id) const;
846 bool hasPendingTalk(PlayerID player_id) const;
847
849 TeamTalkContext getTeamTalkContext(TeamTalkMoment moment, int own_goals = 0,
850 int other_goals = 0) const;
852 bool canGiveTeamTalk(TeamTalkMoment moment) const;
854 std::optional<TeamTalkResult> giveTeamTalk(TeamTalkMoment moment,
855 TeamTalkTone tone,
856 int own_goals = 0,
857 int other_goals = 0);
862 float getTeamTalkModifier(TeamID team_id, int half) const;
864 float getHumanFactorModifier(TeamID team_id, int half) const;
867
868 // ========== Squad management: leaders, statuses, planning ==========
875 bool setSetPieceDesignation(SetPieceDuty duty, PlayerID player_id);
883 void autoPickSetPieces();
884
886 std::optional<SquadStatus> getSquadStatus(PlayerID player_id) const;
896 bool setSquadStatus(PlayerID player_id, std::optional<SquadStatus> status);
897
900 SquadPlan getSquadPlan(int season_offset) const;
904 std::vector<AgendaEvent> getSeasonAgenda() const;
905
906 // ========== Scouting & recruitment ==========
907 // Screens must show and sort other clubs' players by these estimates,
908 // never by Player::getStats()/getOverall()/getPotential().
909
912 std::optional<ScoutedPlayerView> getScoutedView(PlayerID player_id) const;
914 std::optional<ScoutedPlayerRow> getScoutedRow(PlayerID player_id) const;
916 std::vector<ScoutedPlayerRow> searchScoutedPlayers(
917 const ScoutSearchFilter& filter) const;
919 float getScoutingKnowledge(PlayerID player_id) const;
920
921 std::vector<ScoutProfile> getScouts() const;
922 const std::vector<ScoutAssignment>& getScoutAssignments() const;
924 int64_t getScoutAssignmentCost(ScoutTargetKind kind, uint32_t target_id,
925 uint16_t days) const;
928 uint32_t target_id, uint16_t days);
929 bool cancelScoutAssignment(uint32_t assignment_id);
931 const std::vector<ScoutReport>& getScoutReports() const;
934 std::vector<ScoutSummary> getScoutSummaries() const;
936 ScoutExpertise getScoutExpertise(uint32_t scout_id) const;
939 ScoutTargetKind kind,
940 uint32_t target_id) const;
942 size_t getUnreadScoutReportCount() const;
944 bool markScoutReportsSeen(uint32_t scout_id);
945
946 const std::vector<RecruitmentFocus>& getRecruitmentFocuses() const;
948 uint32_t saveRecruitmentFocus(const RecruitmentFocus& focus);
949 bool removeRecruitmentFocus(uint32_t focus_id);
950
951 const std::vector<ShortlistEntry>& getShortlist() const;
952 bool isShortlisted(PlayerID player_id) const;
953 bool addToShortlist(PlayerID player_id);
954 bool removeFromShortlist(PlayerID player_id);
956 std::vector<SquadComparisonRow> compareShortlistWithSquad() const;
957
958 // ========== Training ==========
960 const TeamTrainingPlan* getTrainingPlan() const;
968 bool setCongestionAutoAdjust(bool enabled);
970 bool setPlayerTrainingFocus(PlayerID player_id, TrainingFocus focus);
971
973 {
975 float acute = 0.0f;
976 float chronic = 0.0f;
977 float ratio = 1.0f;
979 float trend = 0.0f;
980 };
983
992 std::vector<TrainingDayPreview> getTrainingWeekPreview() const;
995 float getTacticalFamiliarity(TeamID team_id) const;
997 std::vector<TrainingAdvice> getTrainingAdvice() const;
998
999 // ========== Staff ==========
1000 enum class StaffActionResult : uint8_t
1001 {
1002 Ok,
1003 NoClub,
1005 NotAvailable,
1006 RoleFull,
1007 CannotAfford,
1009 };
1011 std::vector<const StaffMember*> getStaff(TeamID team_id) const;
1013 std::vector<const StaffMember*> getStaffMarket() const;
1015 StaffEffects getStaffEffects(TeamID team_id) const;
1022 float getScoutingAccuracy(TeamID team_id) const;
1024 uint32_t getStaffWageDemand(StaffID staff_id) const;
1026 StaffActionResult hireStaff(StaffID staff_id, uint8_t years);
1031 StaffActionResult extendStaffContract(StaffID staff_id, uint8_t years);
1032
1033 // ========== Youth academy ==========
1060 std::vector<YouthPlayerView> getYouthPlayers(YouthStatus status) const;
1062 std::vector<YouthPlayerView> getYouthEligibleFirstTeam() const;
1065 bool isAcademyPlayer(PlayerID player_id) const;
1066
1084 std::vector<YouthTableRow> getYouthTable() const;
1086 const std::vector<YouthResult>& getYouthResults() const;
1102
1103 // ========== U21 squad ==========
1104 // Implemented in game_controller_career.cpp.
1108 std::vector<YouthPlayerView> getReserveCandidates() const;
1119 std::vector<YouthTableRow> getReserveTable() const;
1121 const std::vector<YouthResult>& getReserveResults() const;
1128
1129 // ========== Manager career ==========
1131 bool hasCareer() const;
1136 bool isUnemployed() const;
1138 const ManagerProfile* getManagerProfile() const;
1141 void createManager(const ManagerSetup& setup);
1142 const std::vector<ManagerStint>& getManagerStints() const;
1143 const std::vector<ManagerSeasonLine>& getManagerSeasons() const;
1144 const std::vector<ManagerAward>& getManagerAwards() const;
1146 const AiManager* getClubManager(TeamID team_id) const;
1147
1164 std::vector<VacancyView> getVacancies() const;
1165 const std::vector<JobApplication>& getJobApplications() const;
1168 std::optional<InterviewResult> attendInterview(
1169 TeamID team_id, std::span<const std::uint8_t> answers);
1170 const std::vector<JobOffer>& getJobOffers() const;
1171 OfferReply negotiateJobOffer(std::uint32_t offer_id, int64_t weekly_wage,
1172 std::uint8_t years);
1177 bool acceptJobOffer(std::uint32_t offer_id);
1178 bool declineJobOffer(std::uint32_t offer_id);
1180 bool resignFromClub();
1185 int advanceWhileUnemployed(int max_days = 7);
1186
1187 // ========== National-team job ==========
1188 // Implemented in game_controller_career.cpp.
1190 const NationalJob* getNationalJob() const;
1191 bool hasNationalJob() const;
1192 const std::vector<NationalStint>& getNationalJobHistory() const;
1195 {
1197 int rank = 0;
1198 float stature = 0.0f;
1199 float chance = 0.0f;
1201 std::int64_t weekly_wage = 0;
1203 bool compatriot = false;
1204 std::optional<NationalApplicationStage> stage;
1205 };
1207 std::vector<NationalVacancyView> getNationalVacancies() const;
1209 const std::vector<NationalJobOffer>& getNationalJobOffers() const;
1211 NationalApplyResult acceptNationalJobOffer(std::uint32_t offer_id);
1212 bool declineNationalJobOffer(std::uint32_t offer_id);
1213 bool resignNationalJob();
1215 bool canCombineClubAndNation() const;
1216
1219 {
1220 PlayerID id = 0;
1221 std::string name;
1223 int age = 0;
1225 int overall = 0;
1226 float form = 0.0f;
1227 int condition = 0;
1228 uint16_t caps = 0;
1229 uint16_t goals = 0;
1230 bool available = true;
1231 bool selected = false;
1232 };
1235 {
1237 bool announced = false;
1238 bool locked = false;
1239 bool finals = false;
1245 std::vector<CallUpCandidate> candidates;
1247 std::vector<International::Fixture> fixtures;
1248 };
1249 CallUpView getCallUpView() const;
1252 const std::vector<PlayerID>& players);
1253
1254 // ========== Guidance: checklist, next steps, delegation, analysis ==========
1255 // Implemented in game_controller_guidance.cpp.
1257 const OnboardingState& getOnboarding() const;
1261 void dismissOnboarding();
1263 void showOnboarding();
1264
1266 std::vector<NextAction> getNextActions(size_t limit = 5) const;
1267
1269 const DelegationPolicy& getDelegation() const;
1271 bool isDelegated(Duty duty) const;
1273 bool setDutyOwner(Duty duty, DutyOwner owner);
1276 const StaffMember* getDelegate() const;
1281 std::optional<Duty> getReclaimedDuty() const { return reclaimed_duty; }
1283 void undoReclaimedDuty();
1285
1294 std::optional<NextFixture> getNextManagedFixture() const;
1299 void markOppositionReportViewed(TeamID opponent);
1300 bool wasOppositionReportViewed(TeamID opponent) const;
1302 bool setOppositionInstruction(TeamID opponent, PlayerID player,
1303 OppositionInstruction instruction);
1305 PlayerID player) const;
1307 std::vector<OppositionOrder> getOppositionInstructions(TeamID opponent) const;
1309 bool applyCounterTactic(const CounterTactic& counter);
1310
1313 {
1315 std::vector<PlayerAnalyticsRow> players;
1316 };
1317 DataHubView getDataHub() const;
1320 std::optional<ManagedMatchSnapshot> getMatchSnapshot(GameDateValue date,
1321 TeamID home_id,
1322 TeamID away_id) const;
1323
1326 bool isInboxDecisionPending(const InboxMessage& message) const;
1327
1328 // ========== Honours: awards, records, hall of fame ==========
1330 const std::vector<AwardRecord>& getAwardHistory() const;
1332 std::vector<AwardRecord> getLeagueAwards(LeagueID league_id,
1333 uint16_t season_year) const;
1335 std::vector<AwardRecord> getPlayerHonours(PlayerID player_id) const;
1338 std::vector<AwardPlayerTally> getAwardRace(LeagueID league_id, bool young,
1339 size_t limit = 5) const;
1340 std::vector<RecordEntry> getClubRecords(TeamID team_id) const;
1341 std::vector<RecordEntry> getLeagueRecords(LeagueID league_id) const;
1342 std::vector<ClubPlayerTotal> getClubTopScorers(TeamID team_id,
1343 size_t limit = 10) const;
1344 std::vector<ClubPlayerTotal> getClubMostAppearances(TeamID team_id,
1345 size_t limit = 10) const;
1346 std::vector<AllTimeRow> getAllTimeTable(LeagueID league_id) const;
1347 std::vector<LegendEntry> getHallOfFame(TeamID team_id) const;
1348
1349 // ========== Board: facility projects ==========
1352 uint32_t seats = 0) const;
1355 uint32_t seats = 0);
1357 std::vector<FacilityProject> getFacilityProjects() const;
1359 uint8_t getMedicalLevel(TeamID team_id) const;
1361 std::optional<GameDateValue> getProjectCooldown(
1362 FacilityProjectType type) const;
1363
1364 // ========== Pre-season planner ==========
1365 std::vector<FriendlySlot> getPreseasonFriendlies() const;
1366 std::vector<OpponentOption> getFriendlyOpponents(GameDateValue date,
1367 OpponentLevel level,
1368 bool abroad) const;
1369 bool setPreseasonFriendly(GameDateValue date, TeamID opponent_id, bool home,
1370 bool tour);
1372 std::vector<FriendlySuggestion> getPreseasonSuggestion() const;
1374 size_t applyPreseasonSuggestion();
1377 bool bookTrainingCamp(TrainingCamp camp);
1378 const PreseasonState& getPreseasonState() const;
1380 int64_t getTourFee(TeamID opponent_id) const;
1381
1382 // ========== Mentoring groups ==========
1383 std::vector<MentoringGroup> getMentoringGroups() const;
1385 uint32_t* group_id = nullptr);
1386 MentoringError addMentee(uint32_t group_id, PlayerID mentee_id);
1387 MentoringError removeMentee(uint32_t group_id, PlayerID mentee_id);
1388 MentoringError dissolveMentoringGroup(uint32_t group_id);
1390 float getMentoringMultiplier(PlayerID player_id) const;
1391
1392 // ========== Holiday / continue until ==========
1394 void setHolidayPreferences(const HolidayPreferences& preferences);
1397 std::optional<GameDateValue> getHolidayTarget(const HolidayPlan& plan) const;
1404 int goOnHoliday(const HolidayPlan& plan);
1406
1408 uint64_t getWorldSeed() const;
1409
1410 const Game* getGame() const { return game.get(); }
1411 Game* getGame() { return game.get(); }
1412
1414 std::shared_ptr<DatabaseConnection> getDbConn() const { return db_conn; }
1415
1417 std::shared_ptr<GameData> getGameData() const { return gamedata; }
1418
1423 {
1424 std::shared_ptr<DatabaseConnection> database;
1425 std::shared_ptr<DatabaseConnection> source;
1427 std::string source_schema;
1428 };
1429 std::shared_ptr<EditorSession> beginEditor();
1430 void cancelEditor();
1433 bool applyEditor(const std::shared_ptr<EditorSession>& session,
1434 const std::vector<RuntimeEditor::Change>& changes,
1435 std::string& error);
1436 bool undoEditor(std::string& error);
1437 bool canUndoEditor() const { return editor_backup != nullptr; }
1439
1442 std::uint64_t getEditorRevision() const { return editor_revision; }
1443
1444 private:
1445 mutable std::mutex runtime_mutex;
1446 std::weak_ptr<EditorSession> editor_session;
1447 std::shared_ptr<DatabaseConnection> editor_backup;
1448 std::vector<RuntimeEditor::Validator> editor_validators;
1449 std::uint64_t editor_revision = 0;
1450 void replaceEditorDatabase(std::shared_ptr<DatabaseConnection> connection);
1451 std::shared_ptr<class DatabaseConnection> db_conn;
1452 std::unique_ptr<Game> game;
1453 std::shared_ptr<class GameData> gamedata;
1454
1455 std::unordered_map<PlayerID, TransferListing> transfer_listings;
1456 std::mt19937 transfer_rng;
1458 std::atomic<int> continue_days_started{0};
1459 std::atomic<int> continue_days_total{0};
1460 std::atomic<bool> continue_stop_requested{false};
1461 std::atomic<ContinueStop> last_continue_stop{ContinueStop::None};
1465 std::optional<DelegationPolicy> delegation_after_holiday;
1466
1471 std::int64_t playtime_before_session = 0;
1472 std::chrono::steady_clock::time_point session_started;
1473 std::optional<SaveError> last_load_error;
1474 mutable std::mutex club_identity_mutex;
1476 mutable std::optional<std::unordered_map<TeamID, ClubIdentity>>
1478 mutable std::mutex save_status_mutex;
1482 bool persistLocked(bool autosave);
1483 void maybeAutosave();
1484 void startSession(int slot, std::int64_t playtime_seconds);
1486 void simulateDay();
1487 bool executeTransfer(PlayerID pid, TeamID buyer_id, TeamID seller_id,
1488 uint32_t price,
1489 std::optional<ContractTerms> contract = std::nullopt);
1493 void processOfferReplies();
1495 OfferOutcome answerCounter(std::uint32_t offer_id);
1497 OfferOutcome answerLoanCounter(std::uint32_t offer_id);
1498 OfferOutcome sendCounter(std::uint32_t offer_id,
1500 bool firm);
1503 bool routeListingBid(PlayerID pid, TeamID bidder_id, uint32_t bid,
1504 bool announce = true);
1506 void absorbListingBids();
1510 void purgeStaleListings();
1512 void clearBidsBy(TeamID team_id);
1514 bool completeAiSale(PlayerID pid);
1516 uint32_t listingPrice(PlayerID pid) const;
1519 bool canPayDeal(const TransferMarket::Deal& deal) const;
1522 bool canPayPreContract(const TransferMarket::Deal& deal) const;
1523
1525 std::vector<TeamID> viewed_opposition;
1527 void runDelegatedDuties();
1529 bool assistant_acting = false;
1530 std::optional<Duty> reclaimed_duty;
1532 void reclaimDuty(Duty duty);
1534 void recordManagedMatch(GameDateValue date, TeamID home_id, TeamID away_id,
1535 const MatchEngine& engine);
1536
1538 std::optional<std::reference_wrapper<Team>> managedClub();
1539 std::optional<std::reference_wrapper<const Team>> managedClub() const;
1542 void syncOppositionOrders();
1543};
FacilityProjectType
Facility project (values are persisted).
Definition board.h:175
ProjectVerdict
The board's answer to a project request.
Definition board.h:184
CupObjective
How far the board expects the domestic cup run to go (persisted).
Definition board.h:32
FinanceObjective
What the board expects from the books (persisted).
Definition board.h:42
ObjectiveGrade
How one objective went, or is going (values are persisted).
Definition board.h:49
BoardObjective
Season objective set from the club's expected finish (persisted).
Definition board.h:22
Seasons, draws, knockouts, prize money and coefficients of the continental club competitions.
Definition continental.h:238
Who handles each duty of the managed club.
Definition delegation.h:61
Manages the core game logic, interacting with teams, leagues, and players.
Definition game_controller.h:70
float getTeamTalkModifier(TeamID team_id, int half) const
Definition game_controller.cpp:3083
std::optional< ScoutedPlayerView > getScoutedView(PlayerID player_id) const
Definition game_controller.cpp:3109
std::optional< DilemmaEffects > getDilemmaEffects(int option) const
Definition game_controller_guidance.cpp:683
bool canCombineClubAndNation() const
Definition game_controller_career.cpp:232
const std::optional< SaveError > & getLastLoadError() const
Definition game_controller.h:132
int advanceWhileUnemployed(int max_days=7)
Definition game_controller.cpp:3423
bool declineNationalJobOffer(std::uint32_t offer_id)
Definition game_controller_career.cpp:218
bool isPlayerAvailable(PlayerID player_id) const
Definition game_controller.cpp:2773
bool buyPlayerWithContract(PlayerID player_id, TeamID buyer_id, uint32_t price, ContractTerms terms)
Definition game_controller.cpp:1225
bool signFreeAgent(PlayerID player_id, TeamID buyer_id)
Definition game_controller.cpp:1263
SaveSlotMetadata getSaveSlotMetadata(int slot) const
Gets metadata for a save slot.
Definition game_controller.cpp:856
StaffActionResult hireStaff(StaffID staff_id, uint8_t years)
Definition game_controller.cpp:3682
std::optional< std::reference_wrapper< const League > > getLeagueById(uint8_t league_id) const
Gets a league by its ID.
Definition game_controller.cpp:316
StaffActionResult
Definition game_controller.h:1001
bool isTransferEmbargoed() const
Definition game_controller.cpp:2698
Game * getGame()
Definition game_controller.h:1411
std::optional< Duty > getReclaimedDuty() const
Definition game_controller.h:1281
std::vector< SaveBackup > getSaveBackups(int slot) const
Definition game_controller.cpp:828
uint16_t getSeasonStartYear(uint16_t season) const
Definition game_controller_season.cpp:125
bool hasSquadRoom() const
Definition game_controller.cpp:2608
std::vector< ClubPlayerTotal > getClubTopScorers(TeamID team_id, size_t limit=10) const
Definition game_controller.cpp:4031
std::vector< FacilityProject > getFacilityProjects() const
Definition game_controller.cpp:4083
void processAITransferActivity()
Definition game_controller.cpp:2055
std::optional< std::reference_wrapper< Team > > managedClub()
Definition game_controller.cpp:3462
const std::vector< std::reference_wrapper< const Team > > & getTeams() const
Gets all teams available in the game.
Definition game_controller.cpp:290
bool setPreseasonFriendly(GameDateValue date, TeamID opponent_id, bool home, bool tour)
Definition game_controller.cpp:4125
std::vector< ScoutSummary > getScoutSummaries() const
Definition game_controller.cpp:3180
void reclaimDuty(Duty duty)
Definition game_controller_guidance.cpp:156
std::vector< LegendEntry > getHallOfFame(TeamID team_id) const
Definition game_controller.cpp:4052
uint32_t listingPrice(PlayerID pid) const
Definition game_controller.cpp:2021
size_t autoFixLineup(TeamID team_id, MatchType type)
Definition game_controller.cpp:532
std::vector< VacancyView > getVacancies() const
Definition game_controller.cpp:3306
void runDelegatedDuties()
Definition game_controller_guidance.cpp:184
MentoringError createMentoringGroup(PlayerID mentor_id, uint32_t *group_id=nullptr)
Definition game_controller.cpp:4215
MentoringError addMentee(uint32_t group_id, PlayerID mentee_id)
Definition game_controller.cpp:4224
std::vector< PlayerID > getIneligibleSelections(TeamID team_id, MatchType type) const
Definition game_controller.cpp:525
bool isDelegated(Duty duty) const
Definition game_controller_guidance.cpp:107
bool setMatchResult(GameDateValue date, uint16_t home_id, uint16_t away_id, uint8_t home_score, uint8_t away_score)
Definition game_controller.cpp:495
std::optional< TeamTalkResult > giveTeamTalk(TeamTalkMoment moment, TeamTalkTone tone, int own_goals=0, int other_goals=0)
Definition game_controller.cpp:3074
const StaffMember * getDelegate() const
Definition game_controller_guidance.cpp:171
std::mutex runtime_mutex
Definition game_controller.h:1445
YouthActionResult promoteYouthPlayer(PlayerID player_id)
Definition game_controller.cpp:3943
ContinueStop getLastContinueStop() const
Definition game_controller.h:301
float getHumanFactorModifier(TeamID team_id, int half) const
Definition game_controller.cpp:3090
float calculateAttentionScore(PlayerID player_id) const
Definition game_controller.cpp:1534
static constexpr int OFF_SEASON_MAX_DAYS
Definition game_controller.h:279
bool exerciseLoanOption(PlayerID player_id)
Definition game_controller.cpp:2615
PlayerActionBlock getRenewalBlock(PlayerID player_id) const
Definition game_controller.cpp:2937
std::vector< Promise > getActivePromises() const
Definition game_controller.cpp:3005
bool acceptJobOffer(std::uint32_t offer_id)
Definition game_controller.cpp:3395
void removePlayerFromTransfer(PlayerID player_id)
Definition game_controller.cpp:972
const std::vector< FinanceTransaction > & getFinanceLedger(TeamID team_id) const
Definition game_controller.cpp:2709
void createManager(const ManagerSetup &setup)
Definition game_controller.cpp:3278
std::atomic< int > continue_days_started
Definition game_controller.h:1458
void markSeasonReviewSeen(uint16_t season)
Definition game_controller_season.cpp:142
void setSimulationThreads(unsigned threads)
Definition game_controller.cpp:457
std::vector< OppositionOrder > getOppositionInstructions(TeamID opponent) const
Definition game_controller_guidance.cpp:518
std::shared_ptr< class GameData > gamedata
Definition game_controller.h:1453
std::vector< TrainingAdvice > getTrainingAdvice() const
Definition game_controller.cpp:3636
YouthActionResult signYouthCandidate(PlayerID player_id)
Definition game_controller.cpp:3918
float randomFloat(float min, float max)
Definition game_controller.h:705
std::shared_ptr< class DatabaseConnection > db_conn
Definition game_controller.h:1451
const std::vector< RecruitmentFocus > & getRecruitmentFocuses() const
Definition game_controller.cpp:3210
bool canRecallLoan(PlayerID player_id) const
Definition game_controller.cpp:2590
float getScoutingKnowledge(PlayerID player_id) const
Definition game_controller.cpp:3130
int64_t getScoutAssignmentCost(ScoutTargetKind kind, uint32_t target_id, uint16_t days) const
Definition game_controller.cpp:3147
bool setCongestionAutoAdjust(bool enabled)
Definition game_controller.cpp:3523
OfferOutcome
Definition game_controller.h:626
bool rejectIncomingOffer(std::uint32_t offer_id)
Definition game_controller_offers.cpp:249
const std::unordered_map< PlayerID, TransferListing > & getAllListings() const
Definition game_controller.cpp:1015
std::optional< Duty > reclaimed_duty
Definition game_controller.h:1530
const std::vector< InboxMessage > & getInbox() const
Definition game_controller.cpp:2677
std::vector< AgendaEvent > getSeasonAgenda() const
Definition game_controller_squad.cpp:273
std::vector< FriendlySlot > getPreseasonFriendlies() const
Definition game_controller.cpp:4108
void simulateDay()
Definition game_controller.cpp:351
std::vector< PlayerSeasonStats > getTopScorers(MatchType competition_type, LeagueID competition_id, size_t limit=10) const
Definition game_controller.cpp:607
void autoPickSetPieces()
Definition game_controller_squad.cpp:103
std::vector< DisciplinaryRecord > getSuspendedPlayers(TeamID team_id) const
Definition game_controller.cpp:671
std::vector< std::pair< PlayerID, PlayerID > > previewLineupFix(TeamID team_id, MatchType type) const
Definition game_controller.cpp:547
void dismissOnboarding()
Definition game_controller_guidance.cpp:82
bool releasePlayer(PlayerID player_id)
Definition game_controller.cpp:2661
std::vector< ScoutProfile > getScouts() const
Definition game_controller.cpp:3135
StaffActionResult releaseStaff(StaffID staff_id)
Definition game_controller.cpp:3708
International::CallUpResult setNationalSquad(const std::vector< PlayerID > &players)
Definition game_controller_career.cpp:327
float getScoutingAccuracy(TeamID team_id) const
Definition game_controller.cpp:3666
bool isInboxDecisionPending(const InboxMessage &message) const
Definition game_controller_guidance.cpp:609
void registerEditorValidator(RuntimeEditor::Validator validator)
Definition game_controller_editor.cpp:219
YouthActionResult promoteReservePlayer(PlayerID player_id)
Definition game_controller_career.cpp:126
std::vector< const TransferListing * > getListingsExcludingTeam(TeamID team_id) const
Definition game_controller.cpp:1020
bool moveTransferToWageBudget(int64_t transfer_amount)
Definition game_controller.cpp:2737
bool cancelScoutAssignment(uint32_t assignment_id)
Definition game_controller.cpp:3166
bool executeTransfer(PlayerID pid, TeamID buyer_id, TeamID seller_id, uint32_t price, std::optional< ContractTerms > contract=std::nullopt)
Definition game_controller.cpp:1130
void markOppositionReportViewed(TeamID opponent)
Definition game_controller_guidance.cpp:475
bool acceptIncomingOffer(std::uint32_t offer_id)
Definition game_controller_offers.cpp:244
void advanceDay()
Advances the game date by one day.
Definition game_controller.cpp:340
void showOnboarding()
Definition game_controller_guidance.cpp:87
UpgradeQuote getAcademyUpgradeQuote(AcademyUpgrade kind) const
Definition game_controller.cpp:3898
std::unordered_map< PlayerID, TransferListing > transfer_listings
Definition game_controller.h:1455
FinanceSummary getFinanceSummary(TeamID team_id, GameDateValue from, GameDateValue to) const
Definition game_controller.cpp:2718
std::vector< StandingRow > getStandings(LeagueID league_id) const
Definition game_controller.cpp:559
std::uint64_t getEditorRevision() const
Definition game_controller.h:1442
int64_t getTourFee(TeamID opponent_id) const
Definition game_controller.cpp:4190
const std::vector< JobOffer > & getJobOffers() const
Definition game_controller.cpp:3380
HolidayPreferences getHolidayPreferences() const
Definition game_controller.cpp:4253
std::vector< MentoringGroup > getMentoringGroups() const
Definition game_controller.cpp:4208
bool addToShortlist(PlayerID player_id)
Definition game_controller.cpp:3238
TransferNegotiation::ClubResponse makeLoanOffer(PlayerID player_id, const TransferNegotiation::LoanTerms &terms)
Definition game_controller.cpp:2499
BuyerNegotiation::PlayerStance playerStance(PlayerID pid, TeamID buyer) const
Definition game_controller_offers.cpp:91
ContinentalCompetitions::TieScore getContinentalTieScore(LeagueID competition_id, const ContinentalCompetitions::Tie &tie) const
Definition game_controller.cpp:634
const ClubIdentity * getClubIdentity(TeamID team_id) const
Descriptive identity of a club from the data pack (short code, kit colours, stadium,...
Definition game_controller.cpp:327
std::vector< PlayerSeasonStats > getPlayerSeasonStats(PlayerID player_id) const
Definition game_controller.cpp:615
uint8_t getMedicalLevel(TeamID team_id) const
Definition game_controller.cpp:4091
bool canAffordPlayer(TeamID buyer_id, PlayerID player_id, uint32_t target_price) const
Definition game_controller.cpp:1052
std::optional< IncomingOfferView > getIncomingOfferView(std::uint32_t offer_id) const
Definition game_controller_offers.cpp:116
std::optional< SquadStatus > getSquadStatus(PlayerID player_id) const
Definition game_controller_squad.cpp:115
std::vector< LeagueID > getCupIds() const
Definition game_controller.cpp:565
void markAllInboxMessagesRead()
Definition game_controller.cpp:2688
const std::vector< ScoutReport > & getScoutReports() const
Definition game_controller.cpp:3174
bool loadGame(int slot)
Loads an existing game from the given save slot.
Definition game_controller.cpp:101
bool canKickOff(TeamID team_id, MatchType type) const
Definition game_controller.cpp:554
const std::vector< IncomingOffer > & getIncomingOffers() const
Definition game_controller.cpp:2644
StaffEffects getStaffEffects(TeamID team_id) const
Definition game_controller.cpp:3661
SquadNeeds evaluateSquadNeeds(TeamID team_id) const
Definition game_controller.cpp:1407
std::vector< Promise > getPlayerPromises(PlayerID player_id) const
Definition game_controller.cpp:2999
OfferOutcome settleIncomingOffer(std::uint32_t offer_id)
Definition game_controller_offers.cpp:171
GameDateValue last_autosave_date
Definition game_controller.h:1469
void processOfferReplies()
Definition game_controller_offers.cpp:363
ScoutExpertise getScoutExpertise(uint32_t scout_id) const
Definition game_controller.cpp:3186
ContractTerms getContractDemand(PlayerID player_id, bool free_agent) const
Definition game_controller.cpp:1086
bool isTransferWindowOpen() const
Definition game_controller.cpp:1378
bool isContinueStopRequested() const
Definition game_controller.h:296
bool removeRecruitmentFocus(uint32_t focus_id)
Definition game_controller.cpp:3222
std::vector< PlayerSeasonStats > getPlayerCareer(PlayerID player_id) const
Definition game_controller.cpp:622
bool canPayDeal(const TransferMarket::Deal &deal) const
Definition game_controller.cpp:2031
std::int64_t playtime_before_session
Definition game_controller.h:1471
std::chrono::steady_clock::time_point session_started
Definition game_controller.h:1472
static const char * continueStopKey(ContinueStop stop)
Definition game_controller_season.cpp:86
std::vector< ClubPlayerTotal > getClubMostAppearances(TeamID team_id, size_t limit=10) const
Definition game_controller.cpp:4038
void newGame(int slot, std::optional< std::uint64_t > world_seed=std::nullopt)
Starts a new game on the given save slot.
Definition game_controller.cpp:57
const std::vector< std::reference_wrapper< const League > > & getLeagues() const
Gets all leagues available in the game.
Definition game_controller.cpp:284
bool restoreBackup(int slot, const std::filesystem::path &backup)
Definition game_controller.cpp:833
std::unique_ptr< Game > game
Definition game_controller.h:1452
bool isGameLoaded() const
Checks if a game is currently loaded.
Definition game_controller.cpp:217
const std::vector< ManagerSeasonLine > & getManagerSeasons() const
Definition game_controller.cpp:3289
bool counterOffer(PlayerID player_id, uint32_t new_price)
Definition game_controller.cpp:1364
int64_t getReleaseCost(PlayerID player_id) const
Definition game_controller.cpp:2650
bool signFreeAgentWithContract(PlayerID player_id, TeamID buyer_id, ContractTerms terms)
Definition game_controller.cpp:1268
OfferOutcome counterLoanOffer(std::uint32_t offer_id, const TransferNegotiation::LoanTerms &terms)
Definition game_controller_offers.cpp:480
TrainingCamp getSuggestedCamp() const
Definition game_controller.cpp:4166
std::optional< NextFixture > getNextManagedFixture() const
Definition game_controller_guidance.cpp:362
OppositionReport getOppositionReport(TeamID opponent) const
Definition game_controller_guidance.cpp:421
SaveStatusInfo save_status
Definition game_controller.h:1479
bool isContractOfferAcceptable(PlayerID player_id, bool free_agent, ContractTerms terms) const
Definition game_controller.cpp:1115
const std::vector< ShortlistEntry > & getShortlist() const
Definition game_controller.cpp:3227
uint32_t getFairTicketPrice(TeamID team_id) const
Definition game_controller.cpp:2756
const NationalJob * getNationalJob() const
Definition game_controller_career.cpp:144
bool isTransferWindowOpenAnywhere() const
Definition game_controller.cpp:1392
const DelegationPolicy & getDelegation() const
Definition game_controller_guidance.cpp:102
void setInboxView(const InboxView &view)
Definition game_controller_guidance.cpp:646
std::shared_ptr< DatabaseConnection > getDbConn() const
Gets the database connection (for repos that need it).
Definition game_controller.h:1414
std::optional< BoardTargets > getBoardTargets() const
Definition game_controller_season.cpp:147
uint32_t transferBudgetForTeam(TeamID team_id) const
Definition game_controller.cpp:1915
void replaceEditorDatabase(std::shared_ptr< DatabaseConnection > connection)
Definition game_controller_editor.cpp:225
std::shared_ptr< EditorSession > beginEditor()
Definition game_controller_editor.cpp:196
void undoReclaimedDuty()
Definition game_controller_guidance.cpp:163
bool hasNationalJob() const
Definition game_controller_career.cpp:150
void syncOppositionOrders()
Definition game_controller_guidance.cpp:498
bool submitBid(PlayerID player_id, TeamID bidder_id, uint32_t bid_amount)
Definition game_controller.cpp:1303
const std::vector< ManagerStint > & getManagerStints() const
Definition game_controller.cpp:3283
std::vector< NationalVacancyView > getNationalVacancies() const
Definition game_controller_career.cpp:162
std::optional< std::reference_wrapper< Team > > getManagedTeam()
Gets the team currently managed by the player (mutable).
Definition game_controller.cpp:240
const std::vector< StandingRow > * getArchivedTable(uint16_t season, LeagueID league_id) const
Definition game_controller_season.cpp:119
uint32_t getReleaseClause(PlayerID player_id) const
Definition game_controller_offers.cpp:639
void setHolidayPreferences(const HolidayPreferences &preferences)
Definition game_controller.cpp:4258
std::vector< AwardRecord > getLeagueAwards(LeagueID league_id, uint16_t season_year) const
Definition game_controller.cpp:3965
ApplyResult applyForJob(TeamID team_id)
Definition game_controller.cpp:3366
void evaluateAndActForTeam(TeamID team_id)
Definition game_controller.cpp:1753
ContractTalkResult proposeContract(PlayerID player_id, const TransferNegotiation::ContractOffer &offer)
Definition game_controller.cpp:2359
MentoringError dissolveMentoringGroup(uint32_t group_id)
Definition game_controller.cpp:4238
OfferOutcome nameAskingPrice(std::uint32_t offer_id, uint32_t price)
Definition game_controller_offers.cpp:291
float getLeagueAttentionMultiplier(LeagueID league_id) const
Definition game_controller.cpp:1570
SquadPlan getSquadPlan(int season_offset) const
Definition game_controller_squad.cpp:155
int getCurrentSeason() const
Gets the current season year.
Definition game_controller.cpp:222
SquadNumbers::Change setSquadNumber(PlayerID player_id, int number)
Definition game_controller_squad.cpp:283
bool renewContract(PlayerID player_id, ContractTerms terms)
Definition game_controller.cpp:2834
SquadStatus getDeservedSquadStatus(PlayerID player_id) const
Definition game_controller_squad.cpp:124
std::vector< RecordEntry > getClubRecords(TeamID team_id) const
Definition game_controller.cpp:4018
bool resignFromClub()
Definition game_controller.cpp:3416
bool applyEditor(const std::shared_ptr< EditorSession > &session, const std::vector< RuntimeEditor::Change > &changes, std::string &error)
Definition game_controller_editor.cpp:247
float getManagerStanding() const
Definition game_controller.cpp:2958
bool hasSelectedTeam() const
Checks if a team has been selected to be managed.
Definition game_controller.cpp:232
const std::vector< NationalJobOffer > & getNationalJobOffers() const
Definition game_controller_career.cpp:202
bool deleteSave(int slot) const
Definition game_controller.cpp:849
std::vector< TeamID > viewed_opposition
Definition game_controller.h:1525
uint8_t getLeagueTier(LeagueID league_id) const
Definition game_controller.cpp:582
std::vector< FriendlySuggestion > getPreseasonSuggestion() const
Definition game_controller.cpp:4139
int advanceToNextEvent(int max_days=OFF_SEASON_MAX_DAYS)
Definition game_controller_season.cpp:18
uint32_t calculateMaxPrice(PlayerID player_id, TeamID buyer_id, const SquadNeeds &needs) const
Definition game_controller.cpp:1597
bool isUnemployed() const
Definition game_controller.cpp:3268
bool setSetPieceDesignation(SetPieceDuty duty, PlayerID player_id)
Definition game_controller_squad.cpp:45
ScoutEffectiveness getScoutEffectiveness(uint32_t scout_id, ScoutTargetKind kind, uint32_t target_id) const
Definition game_controller.cpp:3192
GameController()
Constructs a new GameController.
const International::Record * getInternationalRecord(PlayerID player_id) const
Definition game_controller.cpp:650
void requestContinueStop()
Definition game_controller.h:295
std::uint8_t getContractRoundsLeft(PlayerID player_id) const
Definition game_controller.cpp:2349
std::optional< MatchRules::Knockout > getKnockoutRules(GameDateValue date, TeamID home_id, TeamID away_id) const
Definition game_controller.cpp:516
const NationalTeams * getNationalTeams() const
Definition game_controller.cpp:645
std::vector< AwardPlayerTally > getAwardRace(LeagueID league_id, bool young, size_t limit=5) const
Definition game_controller.cpp:3979
std::vector< YouthTableRow > getYouthTable() const
Definition game_controller.cpp:3885
bool applyMatchConsequences(PlayerID player_id, uint8_t minutes_played, float end_condition, bool injured)
Definition game_controller.cpp:2824
const BoardState & getBoardState() const
Definition game_controller.cpp:2703
OfferOutcome counterIncomingOffer(std::uint32_t offer_id, const TransferNegotiation::OfferTerms &terms)
Definition game_controller_offers.cpp:285
AutosavePolicy getAutosavePolicy() const
Definition game_controller.cpp:817
int64_t getWeeklyWageBill(TeamID team_id) const
Definition game_controller.cpp:2728
HolidaySummary holiday_summary
Definition game_controller.h:1462
NationalApplyResult acceptNationalJobOffer(std::uint32_t offer_id)
Definition game_controller_career.cpp:209
void cancelEditor()
Definition game_controller_editor.cpp:213
YouthActionResult releaseYouthCandidate(PlayerID player_id)
Definition game_controller.cpp:3926
ScoutAssignError startScoutAssignment(uint32_t scout_id, ScoutTargetKind kind, uint32_t target_id, uint16_t days)
Definition game_controller.cpp:3156
std::optional< GameDateValue > getProjectCooldown(FacilityProjectType type) const
Definition game_controller.cpp:4097
MedicalReport getMedicalReport() const
Definition game_controller_squad.cpp:188
const std::vector< ManagerAward > & getManagerAwards() const
Definition game_controller.cpp:3295
TeamTalkContext getTeamTalkContext(TeamTalkMoment moment, int own_goals=0, int other_goals=0) const
Definition game_controller.cpp:3035
ProjectVerdict requestFacilityProject(FacilityProjectType type, uint32_t seats=0)
Definition game_controller.cpp:4072
bool applyCounterTactic(const CounterTactic &counter)
Definition game_controller_guidance.cpp:525
const PreseasonState & getPreseasonState() const
Definition game_controller.cpp:4184
TransferNegotiation::ClubResponse makeTransferOffer(PlayerID player_id, const TransferNegotiation::OfferTerms &terms)
Definition game_controller.cpp:2213
std::optional< TransferNegotiation::ContractKind > getContractTalkKind(PlayerID player_id) const
Definition game_controller.cpp:2299
std::vector< PlayerID > findTargetsForRole(PlayerRole role, TeamID buyer_id, const SquadNeeds &needs) const
Definition game_controller.cpp:1690
bool hasCareer() const
Definition game_controller.cpp:3263
uint32_t getPlayerMarketValue(PlayerID player_id) const
Definition game_controller.cpp:1286
const ContinentalCompetitions * getContinental() const
Definition game_controller.cpp:629
std::optional< InterviewResult > attendInterview(TeamID team_id, std::span< const std::uint8_t > answers)
Definition game_controller.cpp:3372
const std::vector< ScoutAssignment > & getScoutAssignments() const
Definition game_controller.cpp:3141
TransferNegotiation::ContractDemand getPlayerDemand(PlayerID player_id, TransferNegotiation::ContractKind kind) const
Definition game_controller.cpp:2333
void setAutosavePolicy(const AutosavePolicy &policy)
Definition game_controller.cpp:811
bool getAssistantFixesLineup() const
Definition game_controller.cpp:542
ProjectQuote getProjectQuote(FacilityProjectType type, uint32_t seats=0) const
Definition game_controller.cpp:4063
MentoringError removeMentee(uint32_t group_id, PlayerID mentee_id)
Definition game_controller.cpp:4231
void setAssistantFixesLineup(bool enabled)
Definition game_controller.cpp:537
bool resignNationalJob()
Definition game_controller_career.cpp:223
std::vector< RuntimeEditor::Validator > editor_validators
Definition game_controller.h:1448
std::atomic< ContinueStop > last_continue_stop
Definition game_controller.h:1461
const std::vector< std::reference_wrapper< const Player > > & getPlayersForTeam(uint16_t team_id) const
Gets the players belonging to a specific team.
Definition game_controller.cpp:296
YouthActionResult moveToYouthSquad(PlayerID player_id)
Definition game_controller.cpp:3950
std::vector< TrainingDayPreview > getTrainingWeekPreview() const
Definition game_controller.cpp:3567
UpgradeRequestResult requestAcademyUpgrade(AcademyUpgrade kind)
Definition game_controller.cpp:3907
const std::vector< YouthResult > & getYouthResults() const
Definition game_controller.cpp:3892
void evaluateIncomingAIBids()
Definition game_controller.cpp:1936
PotentialEstimate getPotentialEstimate(PlayerID player_id) const
Definition game_controller.cpp:2816
uint64_t getWorldSeed() const
Definition game_controller.cpp:3256
size_t getUnreadInboxCount() const
Definition game_controller.cpp:2693
bool setTrainingIntensity(TrainingIntensity intensity)
Definition game_controller.cpp:3511
void recordManagedMatch(GameDateValue date, TeamID home_id, TeamID away_id, const MatchEngine &engine)
Definition game_controller_guidance.cpp:542
void applyDelegationPreset(DelegationPreset preset)
Definition game_controller_guidance.cpp:144
bool assistant_acting
Definition game_controller.h:1529
std::optional< MatchReport > getMatchReport(GameDateValue date, TeamID home_id, TeamID away_id) const
Definition game_controller.cpp:593
OfferOutcome sendCounter(std::uint32_t offer_id, const TransferNegotiation::OfferTerms &terms, bool firm)
Definition game_controller_offers.cpp:330
const std::vector< JobApplication > & getJobApplications() const
Definition game_controller.cpp:3360
const OnboardingState & getOnboarding() const
Definition game_controller_guidance.cpp:72
std::vector< TalkOptionView > getTalkOptions(PlayerID player_id) const
Definition game_controller.cpp:2968
bool saveGame()
Saves the current state of the game to its slot.
Definition game_controller.cpp:679
void dismissReclaimedDuty()
Definition game_controller.h:1284
SquadRole getSquadRole(PlayerID player_id) const
Definition game_controller.cpp:2811
StaffActionResult extendStaffContract(StaffID staff_id, uint8_t years)
Definition game_controller.cpp:3728
std::optional< SaveError > last_load_error
Definition game_controller.h:1473
PlayerActionBlock
Definition game_controller.h:500
PlayerID getEffectiveSetPieceTaker(SetPieceDuty duty) const
Definition game_controller_squad.cpp:63
ContinueProgress getContinueProgress() const
Definition game_controller.cpp:443
bool recallLoan(PlayerID player_id)
Definition game_controller.cpp:2601
OppositionInstruction getOppositionInstruction(TeamID opponent, PlayerID player) const
Definition game_controller_guidance.cpp:511
OfferReply negotiateJobOffer(std::uint32_t offer_id, int64_t weekly_wage, std::uint8_t years)
Definition game_controller.cpp:3386
const char * getAgentPurchaseLine(PlayerID player_id, const TransferNegotiation::ClubResponse &response) const
Definition game_controller_offers.cpp:625
std::vector< const StaffMember * > getStaffMarket() const
Definition game_controller.cpp:3655
TransferNegotiation::WindowInfo getTransferWindow() const
Definition game_controller.cpp:2191
TransferNegotiation::WindowInfo getTransferWindowFor(TeamID club) const
Definition game_controller.cpp:2198
std::optional< Dilemma > getOpenDilemma() const
Definition game_controller_guidance.cpp:676
static const char * playerActionBlockKey(PlayerActionBlock block)
Definition game_controller.cpp:2845
bool bookTrainingCamp(TrainingCamp camp)
Definition game_controller.cpp:4175
const HolidaySummary & getHolidaySummary() const
Definition game_controller.h:1405
const std::vector< AwardRecord > & getAwardHistory() const
Definition game_controller.cpp:3959
std::vector< PlayerID > getFollowedPlayers() const
Definition game_controller_guidance.cpp:667
uint32_t getLastHomeAttendance(TeamID team_id) const
Definition game_controller.cpp:2768
AutosavePolicy autosave_policy
Definition game_controller.h:1468
bool unfollowPlayer(PlayerID player_id)
Definition game_controller_guidance.cpp:657
std::vector< YouthPlayerView > getReserveCandidates() const
Definition game_controller_career.cpp:33
void maybeAutosave()
Definition game_controller.cpp:785
std::atomic< int > continue_days_total
Definition game_controller.h:1459
std::optional< ManagedMatchSnapshot > getMatchSnapshot(GameDateValue date, TeamID home_id, TeamID away_id) const
Definition game_controller_guidance.cpp:593
std::optional< TalkOutcome > talkToPlayer(PlayerID player_id, TalkOption option)
Definition game_controller.cpp:2977
std::vector< SquadComparisonRow > compareShortlistWithSquad() const
Definition game_controller.cpp:3249
std::vector< const TransferListing * > getListingsByRole(PlayerRole role) const
Definition game_controller.cpp:1034
void clearBidsBy(TeamID team_id)
Definition game_controller.cpp:462
bool acceptBid(PlayerID player_id)
Definition game_controller.cpp:1335
std::optional< std::unordered_map< TeamID, ClubIdentity > > club_identities
Definition game_controller.h:1477
bool isShortlisted(PlayerID player_id) const
Definition game_controller.cpp:3233
void purgeStaleListings()
Definition game_controller.cpp:473
const StatsConfig & getStatsConfig() const
Gets the configuration settings for player stats.
Definition game_controller.cpp:335
bool hasPendingTalk(PlayerID player_id) const
Definition game_controller.cpp:3028
const Game * getGame() const
Definition game_controller.h:1410
bool isTransferWindowOpenFor(TeamID club) const
Definition game_controller.cpp:1384
std::vector< std::reference_wrapper< const Team > > getTeamsInLeague(uint8_t league_id) const
Gets the teams belonging to a specific league.
Definition game_controller.cpp:302
int goOnHoliday(const HolidayPlan &plan)
Definition game_controller.cpp:4287
std::shared_ptr< GameData > getGameData() const
Gets the game data cache.
Definition game_controller.h:1417
const AiManager * getClubManager(TeamID team_id) const
Definition game_controller.cpp:3301
std::vector< NextAction > getNextActions(size_t limit=5) const
Definition game_controller_guidance.cpp:94
ReserveOverview getReserveOverview() const
Definition game_controller_career.cpp:84
std::optional< Competitions::CupStatus > getCupStatus(LeagueID cup_id) const
Definition game_controller.cpp:570
YouthActionResult moveToReserves(PlayerID player_id)
Definition game_controller_career.cpp:118
OfferOutcome answerLoanCounter(std::uint32_t offer_id)
Definition game_controller_offers.cpp:508
PlayerWorkload getPlayerWorkload(PlayerID player_id) const
Definition game_controller.cpp:3547
std::mutex save_status_mutex
Definition game_controller.h:1478
std::vector< YouthTableRow > getReserveTable() const
Definition game_controller_career.cpp:105
bool setTrainingSlot(MicrocycleDay day, TrainingSlot slot)
Definition game_controller.cpp:3494
std::vector< YouthPlayerView > getYouthEligibleFirstTeam() const
Definition game_controller.cpp:3807
CallUpView getCallUpView() const
Definition game_controller_career.cpp:238
PlayerRole getRoleCategory(PlayerRole role) const
Definition game_controller.cpp:1886
CampQuote getCampQuote(TrainingCamp camp) const
Definition game_controller.cpp:4158
size_t getUnreadScoutReportCount() const
Definition game_controller.cpp:3200
std::vector< const StaffMember * > getStaff(TeamID team_id) const
Definition game_controller.cpp:3649
std::string getCupName(LeagueID cup_id) const
Definition game_controller.cpp:577
int current_slot
Definition game_controller.h:1467
std::optional< ScoutedPlayerRow > getScoutedRow(PlayerID player_id) const
Definition game_controller.cpp:3116
std::shared_ptr< DatabaseConnection > editor_backup
Definition game_controller.h:1447
int last_autosave_season
Definition game_controller.h:1470
uint8_t getSuspensionMatches(PlayerID player_id, MatchType scope) const
Definition game_controller.cpp:663
YouthActionResult moveReserveToU18(PlayerID player_id)
Definition game_controller_career.cpp:134
bool persistLocked(bool autosave)
Definition game_controller.cpp:685
PlayerID getSetPieceDesignation(SetPieceDuty duty) const
Definition game_controller_squad.cpp:39
std::vector< RecordEntry > getLeagueRecords(LeagueID league_id) const
Definition game_controller.cpp:4024
std::vector< uint16_t > getArchivedSeasons(LeagueID league_id) const
Definition game_controller_season.cpp:112
bool canPayPreContract(const TransferMarket::Deal &deal) const
Definition game_controller.cpp:2485
bool setDutyOwner(Duty duty, DutyOwner owner)
Definition game_controller_guidance.cpp:132
void selectManagedTeam(uint16_t team_id)
Selects the team for the player to manage.
Definition game_controller.cpp:256
bool setLoanListed(PlayerID player_id, bool listed)
Definition game_controller.cpp:2578
GameDateValue getCurrentDate() const
Gets the current date in the game.
Definition game_controller.cpp:227
PlayerActionBlock getSaleBlock(PlayerID player_id) const
Definition game_controller.cpp:2914
bool isPlayerListed(PlayerID player_id) const
Definition game_controller.cpp:1007
std::vector< YouthPlayerView > getYouthPlayers(YouthStatus status) const
Definition game_controller.cpp:3756
bool canGiveTeamTalk(TeamTalkMoment moment) const
Definition game_controller.cpp:3067
bool undoEditor(std::string &error)
Definition game_controller_editor.cpp:309
const SeasonReview * getUnseenSeasonReview() const
Definition game_controller_season.cpp:137
OfferOutcome answerCounter(std::uint32_t offer_id)
Definition game_controller_offers.cpp:372
bool declineJobOffer(std::uint32_t offer_id)
Definition game_controller.cpp:3411
std::mutex club_identity_mutex
Definition game_controller.h:1474
std::optional< Language > getInternationalDuty(PlayerID player_id) const
Definition game_controller.cpp:656
bool rejectBid(PlayerID player_id)
Definition game_controller.cpp:1353
std::atomic< bool > continue_stop_requested
Definition game_controller.h:1460
NationalApplyResult applyForNationalJob(Language nation)
Definition game_controller_career.cpp:194
void startSession(int slot, std::int64_t playtime_seconds)
Definition game_controller.cpp:774
const TeamTrainingPlan * getTrainingPlan() const
Definition game_controller.cpp:3475
std::optional< int > getCurrentSlot() const
Definition game_controller.cpp:822
bool canUndoEditor() const
Definition game_controller.h:1437
bool markScoutReportsSeen(uint32_t scout_id)
Definition game_controller.cpp:3205
std::vector< PlayerID > getUnavailableLineupPlayers(TeamID team_id) const
Definition game_controller.cpp:2791
std::vector< ScoutedPlayerRow > searchScoutedPlayers(const ScoutSearchFilter &filter) const
Definition game_controller.cpp:3123
PlayerActionBlock getListingBlock(PlayerID player_id) const
Definition game_controller.cpp:2924
const char * getAgentOpeningLine(PlayerID player_id, TransferNegotiation::ContractKind kind) const
Definition game_controller_offers.cpp:617
uint32_t saveRecruitmentFocus(const RecruitmentFocus &focus)
Definition game_controller.cpp:3217
const std::vector< YouthResult > & getReserveResults() const
Definition game_controller_career.cpp:112
bool routeListingBid(PlayerID pid, TeamID bidder_id, uint32_t bid, bool announce=true)
Definition game_controller_offers.cpp:662
bool buyPlayer(PlayerID player_id, TeamID buyer_id, uint32_t price)
Definition game_controller.cpp:1219
uint32_t getStaffWageDemand(StaffID staff_id) const
Definition game_controller.cpp:3672
float last_initialization_milliseconds
Definition game_controller.h:1457
bool canSignFreeAgentFor(TeamID club) const
Definition game_controller.cpp:1397
std::optional< StoryChoice > getStoryChoice(PlayerID player_id) const
Definition game_controller.cpp:3020
void listPlayerForTransfer(PlayerID player_id, uint32_t asking_price)
Definition game_controller.cpp:925
bool declareNotForSale(std::uint32_t offer_id)
Definition game_controller_offers.cpp:307
std::uint64_t editor_revision
Definition game_controller.h:1449
bool setSquadStatus(PlayerID player_id, std::optional< SquadStatus > status)
Definition game_controller_squad.cpp:132
std::vector< OpponentOption > getFriendlyOpponents(GameDateValue date, OpponentLevel level, bool abroad) const
Definition game_controller.cpp:4116
const PlayerRelation * getPlayerRelation(PlayerID player_id) const
Definition game_controller.cpp:2992
float getTacticalFamiliarity(TeamID team_id) const
Definition game_controller.cpp:3630
bool isFollowingPlayer(PlayerID player_id) const
Definition game_controller_guidance.cpp:662
YouthActionResult offerYouthProfessionalContract(PlayerID player_id)
Definition game_controller.cpp:3934
bool setPlayerTrainingFocus(PlayerID player_id, TrainingFocus focus)
Definition game_controller.cpp:3535
bool setTicketPrice(uint32_t price)
Definition game_controller.cpp:2745
std::optional< DelegationPolicy > delegation_after_holiday
Definition game_controller.h:1465
DataHubView getDataHub() const
Definition game_controller_guidance.cpp:559
SaveStatusInfo getSaveStatus() const
Definition game_controller.cpp:768
std::mt19937 transfer_rng
Definition game_controller.h:1456
DressingRoom getDressingRoom() const
Definition game_controller.cpp:3102
std::optional< std::pair< LeagueID, uint16_t > > getArchivedPlacing(uint16_t season, TeamID team_id) const
Definition game_controller_season.cpp:130
PlayerActionBlock getReleaseBlock(PlayerID player_id) const
Definition game_controller.cpp:2899
std::weak_ptr< EditorSession > editor_session
Definition game_controller.h:1446
void absorbListingBids()
Definition game_controller_offers.cpp:712
bool markInboxMessageRead(uint32_t message_id)
Definition game_controller.cpp:2683
size_t applyPreseasonSuggestion()
Definition game_controller.cpp:4148
TransferNegotiation::ClubResponse payReleaseClause(PlayerID player_id)
Definition game_controller_offers.cpp:644
InboxView getInboxView() const
Definition game_controller_guidance.cpp:641
std::optional< GameDateValue > getHolidayTarget(const HolidayPlan &plan) const
Definition game_controller.cpp:4264
std::optional< std::reference_wrapper< const Team > > getTeamById(uint16_t team_id) const
Gets a team by its ID.
Definition game_controller.cpp:321
std::vector< AwardRecord > getPlayerHonours(PlayerID player_id) const
Definition game_controller.cpp:3972
float getMentoringMultiplier(PlayerID player_id) const
Definition game_controller.cpp:4244
std::vector< AllTimeRow > getAllTimeTable(LeagueID league_id) const
Definition game_controller.cpp:4045
int advanceToNextManagedFixture(int max_days=60)
Definition game_controller.cpp:365
bool completeOnboardingTask(OnboardingTask task)
Definition game_controller_guidance.cpp:77
bool isAcademyPlayer(PlayerID player_id) const
Definition game_controller.cpp:3841
AcademyOverview getAcademyOverview() const
Definition game_controller.cpp:3846
bool setTrainingPreset(TrainingPreset preset)
Definition game_controller.cpp:3482
const std::vector< NationalStint > & getNationalJobHistory() const
Definition game_controller_career.cpp:155
std::vector< PlayerID > getInjuredPlayers(TeamID team_id) const
Definition game_controller.cpp:2780
float getLastInitializationMilliseconds() const
Definition game_controller.h:158
const ManagerProfile * getManagerProfile() const
Definition game_controller.cpp:3273
bool removeFromShortlist(PlayerID player_id)
Definition game_controller.cpp:3244
bool completeAiSale(PlayerID pid)
Definition game_controller.cpp:1995
std::vector< Match > getTeamFixtures(TeamID team_id) const
Definition game_controller.cpp:587
PlayerAgent::Demands getAgentDemands(PlayerID player_id, TransferNegotiation::ContractKind kind, std::uint8_t years) const
Definition game_controller_offers.cpp:601
bool wasOppositionReportViewed(TeamID opponent) const
Definition game_controller_guidance.cpp:481
bool setOppositionInstruction(TeamID opponent, PlayerID player, OppositionInstruction instruction)
Definition game_controller_guidance.cpp:486
const std::vector< SeasonHistoryEntry > & getSeasonHistory() const
Definition game_controller.cpp:601
bool resolveDilemma(int option)
Definition game_controller_guidance.cpp:691
bool followPlayer(PlayerID player_id)
Definition game_controller_guidance.cpp:651
Represents the core game state and logic.
Definition game.h:48
Definition match_engine.h:517
National-team calendar, call-ups, matches and records.
Definition national_teams.h:212
Progress of the first-week checklist.
Definition onboarding.h:42
DelegationPreset
Named delegation profiles offered on the delegation screen.
Definition delegation.h:46
DutyOwner
Who takes care of a duty (values are persisted).
Definition delegation.h:39
Duty
Recurring jobs the manager may hand to the backroom staff.
Definition delegation.h:23
ContinueStop
Why the latest Continue, holiday or off-season jump stopped.
Definition game_controller.h:49
TeamTalkTone
Definition interactions.h:250
TeamTalkMoment
Definition interactions.h:244
TalkOption
The human side of management: one-to-one conversations, promises, team talks and the dressing room of...
Definition interactions.h:50
Language
Enum representing supported languages in the game.
Definition languages.h:24
SetPieceDuty
Leadership and dead-ball duties the manager can hand out (values are persisted in the lineup).
Definition lineup.h:27
OfferReply
Definition manager_career.h:294
CoachingLicence
Coaching qualification, lowest first (values are persisted).
Definition manager_career.h:44
ApplyResult
Definition manager_career.h:276
OwnerType
Owner behaviour: scales the patience of the board.
Definition manager_career.h:85
bool day
Definition match_stadium_3d.cpp:447
MentoringError
Why a mentoring change was refused.
Definition mentoring.h:24
PlayerStance
Definition buyer_negotiation.h:157
CallUpResult
Why a squad chosen by a head coach was refused.
Definition national_teams.h:170
constexpr size_t WINDOW_SQUAD
Definition national_teams.h:160
float uniformReal(Engine &engine, float lo, float hi)
Definition world_rng.h:192
std::function< void(sqlite3 *, const std::vector< Change > &)> Validator
Definition runtime_editor.h:98
Change
Definition squad_numbers.h:42
ContractKind
Definition transfer_negotiation.h:193
NationalApplyResult
Definition national_job.h:93
OnboardingTask
Steps of the first-week checklist of a new career.
Definition onboarding.h:22
TrainingCamp
Pre-season training camp (values are persisted).
Definition preseason.h:27
OpponentLevel
Opponent strength relative to the managed club.
Definition preseason.h:36
SaveStatus
Definition save_manager.h:27
ScoutTargetKind
What an assignment covers (values are persisted).
Definition scouting.h:102
ScoutAssignError
Why an assignment could not be started.
Definition scouting.h:112
SquadStatus
Place in the squad the manager gives a player (values persisted).
Definition squad_status.h:31
std::uint32_t StaffID
Type alias for staff identifiers.
Definition staff.h:30
Contains structures to simplify JSON parsing and loading of player statistics.
Academy ratings shown on the overview (1-100).
Definition youth_academy.h:237
A computer-controlled manager, employed or looking for work.
Definition manager_career.h:190
Definition save_manager.h:145
The board's view of the manager of the managed club.
Definition board.h:69
Cost, dates and effect of a training camp.
Definition preseason.h:63
Descriptive club data read from the team files of the data pack.
Definition datagenerator.h:29
Definition continental.h:293
Definition continental.h:254
A suggested adjustment of the managed tactic.
Definition opposition_report.h:82
Summary of the managed squad's social state.
Definition interactions.h:334
Per-category totals of a ledger range.
Definition finances.h:67
Definition game_controller.h:1068
bool preview_ready
Definition game_controller.h:1074
HeadOfYouth head
Definition game_controller.h:1070
int league_position
Definition game_controller.h:1078
GameDateValue intake_date
Definition game_controller.h:1072
size_t candidates
Definition game_controller.h:1076
YouthTableRow table
Definition game_controller.h:1080
IntakePreview preview
Definition game_controller.h:1075
AcademyRatings ratings
Definition game_controller.h:1069
GameDateValue preview_date
Definition game_controller.h:1071
GameDateValue decision_deadline
Definition game_controller.h:1073
size_t squad
Definition game_controller.h:1077
int league_size
Definition game_controller.h:1079
The board's targets this season and how they are going.
Definition game_controller.h:741
bool cup_still_in
Definition game_controller.h:748
FinanceObjective finances
Definition game_controller.h:749
ObjectiveGrade youth_grade
Definition game_controller.h:754
int target_position
Definition game_controller.h:743
std::uint8_t youth_target
Definition game_controller.h:752
int position
Definition game_controller.h:744
CupObjective cup
Definition game_controller.h:746
int young_regulars
Definition game_controller.h:753
BoardObjective league
Definition game_controller.h:742
std::int64_t start_balance
Definition game_controller.h:751
ObjectiveGrade cup_grade
Definition game_controller.h:747
ObjectiveGrade finance_grade
Definition game_controller.h:750
ObjectiveGrade league_grade
Definition game_controller.h:745
Definition game_controller.h:1219
bool selected
Definition game_controller.h:1231
uint16_t caps
Definition game_controller.h:1228
int overall
Definition game_controller.h:1225
int age
Definition game_controller.h:1223
PlayerRole role
Definition game_controller.h:1222
bool available
Definition game_controller.h:1230
TeamID club
Definition game_controller.h:1224
uint16_t goals
Definition game_controller.h:1229
float form
Definition game_controller.h:1226
int condition
Definition game_controller.h:1227
std::string name
Definition game_controller.h:1221
Definition game_controller.h:1235
std::vector< CallUpCandidate > candidates
Definition game_controller.h:1245
bool finals
Definition game_controller.h:1239
std::vector< International::Fixture > fixtures
Definition game_controller.h:1247
bool locked
Definition game_controller.h:1238
Language nation
Definition game_controller.h:1236
GameDateValue until
Definition game_controller.h:1241
GameDateValue start
Definition game_controller.h:1240
size_t limit
Definition game_controller.h:1243
bool announced
Definition game_controller.h:1237
GameDateValue next_announcement
Definition game_controller.h:1242
Definition game_controller.h:307
int days_total
Definition game_controller.h:310
uint32_t matches_done
Definition game_controller.h:312
float fraction() const
Definition game_controller.cpp:433
uint32_t matches_total
Definition game_controller.h:313
int days_done
Definition game_controller.h:309
Definition game_controller.h:526
bool completed
Definition game_controller.h:533
const char * agent_line
Definition game_controller.h:532
PlayerActionBlock block
Definition game_controller.h:529
bool over_budget
Definition game_controller.h:534
std::uint8_t rounds_left
Definition game_controller.h:535
TransferNegotiation::ContractResponse response
Definition game_controller.h:527
Definition game_controller.h:73
uint32_t weekly_wage
Definition game_controller.h:74
uint8_t years
Definition game_controller.h:75
Definition game_controller.h:1313
std::vector< PlayerAnalyticsRow > players
Definition game_controller.h:1315
TeamAnalytics team
Definition game_controller.h:1314
Definition game_controller.h:1423
int source_changes
Definition game_controller.h:1426
std::shared_ptr< DatabaseConnection > source
Definition game_controller.h:1425
std::string source_schema
Definition game_controller.h:1427
std::shared_ptr< DatabaseConnection > database
Definition game_controller.h:1424
Definition game_controller.h:589
bool window_open
Definition game_controller.h:618
TransferNegotiation::OfferTerms asked
Definition game_controller.h:607
PlayerActionBlock sale_block
Definition game_controller.h:615
OfferStatus status
Definition game_controller.h:603
GameDateValue expires
Definition game_controller.h:604
std::uint32_t asking_price
Definition game_controller.h:598
BuyerNegotiation::PlayerStance stance
Definition game_controller.h:600
SquadRole role
Definition game_controller.h:596
int days_to_deadline
Definition game_controller.h:619
TransferNegotiation::OfferTerms terms
Definition game_controller.h:606
std::uint8_t rivals
Definition game_controller.h:602
std::uint32_t offer_id
Definition game_controller.h:590
int age
Definition game_controller.h:595
TransferNegotiation::LoanTerms loan_terms
Definition game_controller.h:609
std::uint32_t market_value
Definition game_controller.h:597
std::uint8_t contract_years
Definition game_controller.h:599
TeamID buyer
Definition game_controller.h:592
std::uint32_t release_clause
Definition game_controller.h:612
GameDateValue respond_on
Definition game_controller.h:605
TransferNegotiation::LoanTerms asked_loan
Definition game_controller.h:610
bool final_offer
Definition game_controller.h:617
std::string buyer_name
Definition game_controller.h:594
PlayerID player_id
Definition game_controller.h:591
int season_weeks
Definition game_controller.h:613
std::vector< OfferRound > history
Definition game_controller.h:616
std::uint32_t weekly_wage
Definition game_controller.h:611
bool loan
Definition game_controller.h:608
std::string player_name
Definition game_controller.h:593
Definition game_controller.h:1195
std::int64_t weekly_wage
Definition game_controller.h:1201
Language nation
Definition game_controller.h:1196
float chance
Definition game_controller.h:1199
CoachingLicence required_licence
Definition game_controller.h:1200
bool compatriot
Definition game_controller.h:1203
int rank
Definition game_controller.h:1197
GameDateValue opened
Definition game_controller.h:1202
std::optional< NationalApplicationStage > stage
Definition game_controller.h:1204
float stature
Definition game_controller.h:1198
Definition game_controller.h:1288
TeamID opponent
Definition game_controller.h:1290
bool home
Definition game_controller.h:1291
MatchType type
Definition game_controller.h:1292
GameDateValue date
Definition game_controller.h:1289
Definition game_controller.h:973
float trend
Definition game_controller.h:979
float chronic
Definition game_controller.h:976
WorkloadRisk risk
Definition game_controller.h:978
float acute
Definition game_controller.h:975
float ratio
Definition game_controller.h:977
TrainingFocus focus
Definition game_controller.h:974
Definition game_controller.h:799
float high
Definition game_controller.h:801
float low
Definition game_controller.h:800
Definition game_controller.h:1110
int league_position
Definition game_controller.h:1112
Language country
Definition game_controller.h:1115
YouthTableRow table
Definition game_controller.h:1114
ReserveQuota quota
Definition game_controller.h:1111
int league_size
Definition game_controller.h:1113
Definition game_controller.h:79
std::string team_name
Definition game_controller.h:81
const char * status_key
Definition game_controller.h:87
int backups
Restorable previous saves (<slot>.bak.N).
Definition game_controller.h:95
std::string game_date
Definition game_controller.h:82
std::string game_version
Definition game_controller.h:94
int supported_schema_version
Definition game_controller.h:91
std::string last_saved_game_date
Definition game_controller.h:92
bool exists
Definition game_controller.h:80
SaveStatus status
Definition game_controller.h:85
std::int64_t playtime_seconds
Definition game_controller.h:89
int schema_version
Definition game_controller.h:90
std::string real_date
Definition game_controller.h:83
std::string last_saved_utc
ISO-8601, empty for old saves.
Definition game_controller.h:93
int season
Definition game_controller.h:88
Definition game_controller.h:100
SaveError error
error.langKey() for the UI message.
Definition game_controller.h:103
std::string game_date
In-game date of the save.
Definition game_controller.h:105
bool autosave
Definition game_controller.h:102
bool ok
Definition game_controller.h:101
SaveTimings timings
Definition game_controller.h:104
int successful_saves
Since the game was loaded.
Definition game_controller.h:106
Definition game_controller.h:668
int surplus_cb
Definition game_controller.h:678
int surplus_lb
Definition game_controller.h:679
int surplus_gk
Definition game_controller.h:677
int surplus_rb
Definition game_controller.h:680
int missing_wing
Definition game_controller.h:674
int missing_lb
Definition game_controller.h:671
std::optional< PlayerRole > upgrade_target
Definition game_controller.h:686
int missing_gk
Definition game_controller.h:669
int surplus_wing
Definition game_controller.h:682
int missing_cb
Definition game_controller.h:670
int surplus_st
Definition game_controller.h:683
int missing_mid
Definition game_controller.h:673
int missing_rb
Definition game_controller.h:672
int surplus_mid
Definition game_controller.h:681
int missing_st
Definition game_controller.h:675
Definition game_controller.h:985
GameDateValue date
Definition game_controller.h:986
bool home
Definition game_controller.h:989
TeamID opponent
Definition game_controller.h:988
TrainingDay day
Definition game_controller.h:987
Definition game_controller.h:1150
int expected_position
Definition game_controller.h:1155
uint8_t tier
Definition game_controller.h:1153
LeagueID league_id
Definition game_controller.h:1152
TeamID team_id
Definition game_controller.h:1151
float chance
Definition game_controller.h:1158
const char * objective_key
Definition game_controller.h:1156
CoachingLicence required_licence
Definition game_controller.h:1159
GameDateValue opened
Definition game_controller.h:1160
OwnerType owner
Definition game_controller.h:1157
std::optional< ApplicationStage > stage
Definition game_controller.h:1161
uint8_t reputation
Definition game_controller.h:1154
Definition game_controller.h:1036
Language nationality
Definition game_controller.h:1041
int contract_years
Definition game_controller.h:1045
uint16_t appearances
Definition game_controller.h:1053
PlayerRole role
Definition game_controller.h:1039
uint16_t goals
Definition game_controller.h:1054
YouthContract offer
Definition game_controller.h:1047
bool homegrown
Definition game_controller.h:1051
uint32_t offer_wage
Definition game_controller.h:1048
const char * personality_key
Definition game_controller.h:1050
uint8_t height
Definition game_controller.h:1042
YouthStatus status
Definition game_controller.h:1043
float average_rating
Definition game_controller.h:1055
std::string name
Definition game_controller.h:1038
YouthEstimate estimate
Definition game_controller.h:1049
int age
Definition game_controller.h:1040
uint32_t wage
Definition game_controller.h:1046
bool loan_listed
Definition game_controller.h:1052
std::vector< YouthProgressPoint > progress
Definition game_controller.h:1057
YouthContract contract
Definition game_controller.h:1044
Represents a specific date in the game world.
Definition gamedate.h:20
The club's head of youth development (id 0: vacant).
Definition youth_academy.h:226
A holiday request.
Definition holiday.h:67
What stops a holiday early and what the assistant takes over (persisted with the save).
Definition holiday.h:52
The assistant's report when the manager returns.
Definition holiday.h:128
A news item for the managed club.
Definition inbox.h:84
Filters of the inbox screen, kept with the career (table InboxView) so they survive a scene change an...
Definition inbox.h:63
What the head of youth development says before intake day.
Definition youth_academy.h:217
Definition national_teams.h:135
The human manager.
Definition manager_career.h:113
What the new-game manager step collects.
Definition manager_career.h:136
The managed club's medical centre: who is out, who is at risk and what the medical staff contributes.
Definition medical_centre.h:103
The human manager in charge of a national team.
Definition national_job.h:28
The pre-match opposition report.
Definition opposition_report.h:118
Definition player_agent.h:39
A managed player's relationship with the manager (persisted).
Definition interactions.h:176
The season's pre-season choices (persisted).
Definition preseason.h:84
Cost, duration and size of a project for one club.
Definition board.h:197
A squad need scouts prioritise. Zero limits mean "no limit".
Definition scouting.h:181
Over-age places used in a club's U21 squad.
Definition youth_academy.h:158
Definition save_manager.h:49
Definition save_manager.h:125
How well a scout will do on an assignment.
Definition scout_expertise.h:141
Where a scout comes from and what he knows.
Definition scout_expertise.h:107
Player search on estimated values. Zero limits mean "no limit".
Definition scouting.h:288
The managed club's season as the end-of-season summary shows it (persisted once per season).
Definition season_review.h:79
Depth chart, needs, age profile and contract calendar of a squad for the current season (offset 0) or...
Definition squad_planner.h:120
What a club's staff does for the squad (all bounded).
Definition staff.h:105
A coach, medic, scout or academy manager.
Definition staff.h:78
Configuration mapping roles to their focus areas and listing all possible stats.
Definition stats_config.h:42
Team analytics of the data hub.
Definition data_hub.h:137
Situation of a team talk.
Definition interactions.h:269
A club's schedule, familiarity and training load.
Definition training.h:158
What a club does on one calendar day.
Definition training.h:145
One day of the template.
Definition training.h:125
Definition transfer_market.h:225
Definition transfer_negotiation.h:167
Definition transfer_negotiation.h:245
Definition transfer_negotiation.h:202
Definition transfer_negotiation.h:273
Definition transfer_negotiation.h:299
A club-to-club offer: fee, instalments, add-ons and sell-on.
Definition transfer_negotiation.h:100
Definition transfer_negotiation.h:337
Price and schedule of the next step of an academy investment.
Definition youth_academy.h:255
Scouted ranges of an academy player (never exact values).
Definition youth_academy.h:246
A club's row in its U18 league.
Definition youth_academy.h:134
OppositionInstruction
Individual instruction against one opposing player (values are persisted in OppositionInstructions; a...
Definition tactics.h:77
Weekly training microcycle, workload, individual focus and tactical familiarity.
WorkloadRisk
Injury risk band from workload and freshness.
Definition training.h:192
MicrocycleDay
Training days between two matches of a one-match week.
Definition training.h:53
TrainingFocus
Individual training focus of a player (values are persisted).
Definition training.h:107
TrainingPreset
Schedule templates (values are persisted).
Definition training.h:94
TrainingIntensity
Session or squad-wide intensity (values are persisted).
Definition training.h:85
OfferStatus
Definition transfer_market.h:145
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
uint32_t PlayerID
Type alias for Player identifiers.
Definition types.h:21
PlayerRole
Represents a specific tactical role on the pitch.
Definition types.h:63
SquadRole
Playing-time expectation derived from ability rank in the squad.
Definition world_simulation.h:70
YouthStatus
Where an academy player stands (values are persisted).
Definition youth_academy.h:37
YouthActionResult
Outcome of an action on an academy player.
Definition youth_academy.h:71
YouthContract
Contract of an academy player (values are persisted).
Definition youth_academy.h:46
UpgradeRequestResult
Board answer to an academy investment request.
Definition youth_academy.h:83
AcademyUpgrade
Academy investments the board can approve (values are persisted).
Definition youth_academy.h:63