Player12
An open source football management simulator
Loading...
Searching...
No Matches
GameController Class Reference

Manages the core game logic, interacting with teams, leagues, and players. More...

#include <game_controller.h>

Classes

struct  AcademyOverview
 
struct  BoardTargets
 The board's targets this season and how they are going. More...
 
struct  CallUpCandidate
 
struct  CallUpView
 
struct  ContinueProgress
 
struct  ContractTalkResult
 
struct  ContractTerms
 
struct  DataHubView
 
struct  EditorSession
 
struct  IncomingOfferView
 
struct  NationalVacancyView
 
struct  NextFixture
 
struct  PlayerWorkload
 
struct  PotentialEstimate
 
struct  ReserveOverview
 
struct  SaveSlotMetadata
 
struct  SaveStatusInfo
 
struct  SquadNeeds
 
struct  TrainingDayPreview
 
struct  VacancyView
 
struct  YouthPlayerView
 

Public Types

enum class  PlayerActionBlock : std::uint8_t {
  None , NotYours , WindowClosed , OnLoan ,
  Leaving , SquadFloor , LastGoalkeeper , MaxLength ,
  NotLonger , TooLong , TalksEnded , SquadFull
}
 
enum class  OfferOutcome : std::uint8_t {
  Sold , AwaitingReply , Countered , WalkedAway ,
  Rejected , TermsRefused , SquadTooSmall , Failed
}
 
enum class  StaffActionResult : uint8_t {
  Ok , NoClub , UnknownStaff , NotAvailable ,
  RoleFull , CannotAfford , InvalidTerms
}
 

Public Member Functions

 GameController ()
 Constructs a new GameController.
 
void newGame (int slot, std::optional< std::uint64_t > world_seed=std::nullopt)
 Starts a new game on the given save slot.
 
bool loadGame (int slot)
 Loads an existing game from the given save slot.
 
const std::optional< SaveError > & getLastLoadError () const
 
std::optional< int > getCurrentSlot () const
 
std::vector< SaveBackup > getSaveBackups (int slot) const
 
bool restoreBackup (int slot, const std::filesystem::path &backup)
 
bool deleteSave (int slot) const
 
void setAutosavePolicy (const AutosavePolicy &policy)
 
AutosavePolicy getAutosavePolicy () const
 
float getLastInitializationMilliseconds () const
 
bool isGameLoaded () const
 Checks if a game is currently loaded.
 
int getCurrentSeason () const
 Gets the current season year.
 
GameDateValue getCurrentDate () const
 Gets the current date in the game.
 
bool hasSelectedTeam () const
 Checks if a team has been selected to be managed.
 
std::optional< std::reference_wrapper< Team > > getManagedTeam ()
 Gets the team currently managed by the player (mutable).
 
std::optional< std::reference_wrapper< const Team > > getManagedTeam () const
 Gets the team currently managed by the player (read-only).
 
void selectManagedTeam (uint16_t team_id)
 Selects the team for the player to manage.
 
const std::vector< std::reference_wrapper< const League > > & getLeagues () const
 Gets all leagues available in the game.
 
const std::vector< std::reference_wrapper< const Team > > & getTeams () const
 Gets all teams available in the game.
 
const std::vector< std::reference_wrapper< const Player > > & getPlayersForTeam (uint16_t team_id) const
 Gets the players belonging to a specific team.
 
SquadNumbers::Change setSquadNumber (PlayerID player_id, int number)
 
std::vector< std::reference_wrapper< const Team > > getTeamsInLeague (uint8_t league_id) const
 Gets the teams belonging to a specific league.
 
std::optional< std::reference_wrapper< const League > > getLeagueById (uint8_t league_id) const
 Gets a league by its ID.
 
std::optional< std::reference_wrapper< const Team > > getTeamById (uint16_t team_id) const
 Gets a team by its ID.
 
const ClubIdentity * getClubIdentity (TeamID team_id) const
 Descriptive identity of a club from the data pack (short code, kit colours, stadium, founding year, nickname). Loaded once on first use and cached; UI thread only.
 
const StatsConfig & getStatsConfig () const
 Gets the configuration settings for player stats.
 
void advanceDay ()
 Advances the game date by one day.
 
int advanceToNextManagedFixture (int max_days=60)
 
int advanceToNextEvent (int max_days=OFF_SEASON_MAX_DAYS)
 
void requestContinueStop ()
 
bool isContinueStopRequested () const
 
ContinueStop getLastContinueStop () const
 
ContinueProgress getContinueProgress () const
 
void setSimulationThreads (unsigned threads)
 
bool setMatchResult (GameDateValue date, uint16_t home_id, uint16_t away_id, uint8_t home_score, uint8_t away_score)
 
bool setMatchResult (GameDateValue date, uint16_t home_id, uint16_t away_id, const MatchEngine &engine)
 
std::optional< MatchRules::Knockout > getKnockoutRules (GameDateValue date, TeamID home_id, TeamID away_id) const
 
std::vector< PlayerID > getIneligibleSelections (TeamID team_id, MatchType type) const
 
size_t autoFixLineup (TeamID team_id, MatchType type)
 
std::vector< std::pair< PlayerID, PlayerID > > previewLineupFix (TeamID team_id, MatchType type) const
 
bool canKickOff (TeamID team_id, MatchType type) const
 
void setAssistantFixesLineup (bool enabled)
 
bool getAssistantFixesLineup () const
 
std::vector< StandingRow > getStandings (LeagueID league_id) const
 
std::vector< LeagueID > getCupIds () const
 
std::optional< Competitions::CupStatus > getCupStatus (LeagueID cup_id) const
 
std::string getCupName (LeagueID cup_id) const
 
uint8_t getLeagueTier (LeagueID league_id) const
 
std::vector< Match > getTeamFixtures (TeamID team_id) const
 
std::optional< MatchReport > getMatchReport (GameDateValue date, TeamID home_id, TeamID away_id) const
 
const std::vector< SeasonHistoryEntry > & getSeasonHistory () const
 
std::vector< uint16_t > getArchivedSeasons (LeagueID league_id) const
 
const std::vector< StandingRow > * getArchivedTable (uint16_t season, LeagueID league_id) const
 
uint16_t getSeasonStartYear (uint16_t season) const
 
std::optional< std::pair< LeagueID, uint16_t > > getArchivedPlacing (uint16_t season, TeamID team_id) const
 
const SeasonReview * getUnseenSeasonReview () const
 
void markSeasonReviewSeen (uint16_t season)
 
std::vector< PlayerSeasonStats > getTopScorers (MatchType competition_type, LeagueID competition_id, size_t limit=10) const
 
std::vector< PlayerSeasonStats > getPlayerSeasonStats (PlayerID player_id) const
 
std::vector< PlayerSeasonStats > getPlayerCareer (PlayerID player_id) const
 
const ContinentalCompetitions * getContinental () const
 
ContinentalCompetitions::TieScore getContinentalTieScore (LeagueID competition_id, const ContinentalCompetitions::Tie &tie) const
 
const NationalTeams * getNationalTeams () const
 
const International::Record * getInternationalRecord (PlayerID player_id) const
 
std::optional< Language > getInternationalDuty (PlayerID player_id) const
 
uint8_t getSuspensionMatches (PlayerID player_id, MatchType scope) const
 
std::vector< DisciplinaryRecord > getSuspendedPlayers (TeamID team_id) const
 
bool saveGame ()
 Saves the current state of the game to its slot.
 
SaveStatusInfo getSaveStatus () const
 
SaveSlotMetadata getSaveSlotMetadata (int slot) const
 Gets metadata for a save slot.
 
void listPlayerForTransfer (PlayerID player_id, uint32_t asking_price)
 
void removePlayerFromTransfer (PlayerID player_id)
 
bool isPlayerListed (PlayerID player_id) const
 
const std::unordered_map< PlayerID, TransferListing > & getAllListings () const
 
std::vector< const TransferListing * > getListingsExcludingTeam (TeamID team_id) const
 
std::vector< const TransferListing * > getListingsByRole (PlayerRole role) const
 
bool canAffordPlayer (TeamID buyer_id, PlayerID player_id, uint32_t target_price) const
 
bool canAffordPlayer (TeamID buyer_id, PlayerID player_id, uint32_t target_price, uint32_t offered_weekly_wage) const
 
bool buyPlayer (PlayerID player_id, TeamID buyer_id, uint32_t price)
 
bool buyPlayerWithContract (PlayerID player_id, TeamID buyer_id, uint32_t price, ContractTerms terms)
 
bool signFreeAgent (PlayerID player_id, TeamID buyer_id)
 
bool signFreeAgentWithContract (PlayerID player_id, TeamID buyer_id, ContractTerms terms)
 
ContractTerms getContractDemand (PlayerID player_id, bool free_agent) const
 
bool isContractOfferAcceptable (PlayerID player_id, bool free_agent, ContractTerms terms) const
 
uint32_t getPlayerMarketValue (PlayerID player_id) const
 
bool submitBid (PlayerID player_id, TeamID bidder_id, uint32_t bid_amount)
 
bool acceptBid (PlayerID player_id)
 
bool rejectBid (PlayerID player_id)
 
bool counterOffer (PlayerID player_id, uint32_t new_price)
 
bool isTransferWindowOpen () const
 
bool isTransferWindowOpenFor (TeamID club) const
 
bool isTransferWindowOpenAnywhere () const
 
bool canSignFreeAgentFor (TeamID club) const
 
TransferNegotiation::WindowInfo getTransferWindow () const
 
TransferNegotiation::WindowInfo getTransferWindowFor (TeamID club) const
 
TransferNegotiation::ClubResponse makeTransferOffer (PlayerID player_id, const TransferNegotiation::OfferTerms &terms)
 
std::optional< TransferNegotiation::ContractKind > getContractTalkKind (PlayerID player_id) const
 
TransferNegotiation::ContractDemand getPlayerDemand (PlayerID player_id, TransferNegotiation::ContractKind kind) const
 
PlayerActionBlock getReleaseBlock (PlayerID player_id) const
 
PlayerActionBlock getSaleBlock (PlayerID player_id) const
 
PlayerActionBlock getListingBlock (PlayerID player_id) const
 
PlayerActionBlock getRenewalBlock (PlayerID player_id) const
 
ContractTalkResult proposeContract (PlayerID player_id, const TransferNegotiation::ContractOffer &offer)
 
std::uint8_t getContractRoundsLeft (PlayerID player_id) const
 
PlayerAgent::Demands getAgentDemands (PlayerID player_id, TransferNegotiation::ContractKind kind, std::uint8_t years) const
 
const char * getAgentOpeningLine (PlayerID player_id, TransferNegotiation::ContractKind kind) const
 
const char * getAgentPurchaseLine (PlayerID player_id, const TransferNegotiation::ClubResponse &response) const
 
uint32_t getReleaseClause (PlayerID player_id) const
 
TransferNegotiation::ClubResponse payReleaseClause (PlayerID player_id)
 
TransferNegotiation::ClubResponse makeLoanOffer (PlayerID player_id, const TransferNegotiation::LoanTerms &terms)
 
bool setLoanListed (PlayerID player_id, bool listed)
 
bool recallLoan (PlayerID player_id)
 
bool canRecallLoan (PlayerID player_id) const
 
bool hasSquadRoom () const
 
bool exerciseLoanOption (PlayerID player_id)
 
const std::vector< IncomingOffer > & getIncomingOffers () const
 
std::optional< IncomingOfferView > getIncomingOfferView (std::uint32_t offer_id) const
 
OfferOutcome settleIncomingOffer (std::uint32_t offer_id)
 
bool acceptIncomingOffer (std::uint32_t offer_id)
 
bool rejectIncomingOffer (std::uint32_t offer_id)
 
OfferOutcome counterIncomingOffer (std::uint32_t offer_id, const TransferNegotiation::OfferTerms &terms)
 
OfferOutcome counterLoanOffer (std::uint32_t offer_id, const TransferNegotiation::LoanTerms &terms)
 
OfferOutcome nameAskingPrice (std::uint32_t offer_id, uint32_t price)
 
bool declareNotForSale (std::uint32_t offer_id)
 
int64_t getReleaseCost (PlayerID player_id) const
 
bool releasePlayer (PlayerID player_id)
 
SquadNeeds evaluateSquadNeeds (TeamID team_id) const
 
float calculateAttentionScore (PlayerID player_id) const
 
float getLeagueAttentionMultiplier (LeagueID league_id) const
 
uint32_t calculateMaxPrice (PlayerID player_id, TeamID buyer_id, const SquadNeeds &needs) const
 
void evaluateAndActForTeam (TeamID team_id)
 
std::vector< PlayerID > findTargetsForRole (PlayerRole role, TeamID buyer_id, const SquadNeeds &needs) const
 
PlayerRole getRoleCategory (PlayerRole role) const
 
uint32_t transferBudgetForTeam (TeamID team_id) const
 
float randomFloat (float min, float max)
 
const std::vector< InboxMessage > & getInbox () const
 
bool markInboxMessageRead (uint32_t message_id)
 
void markAllInboxMessagesRead ()
 
size_t getUnreadInboxCount () const
 
InboxView getInboxView () const
 
void setInboxView (const InboxView &view)
 
bool followPlayer (PlayerID player_id)
 
bool unfollowPlayer (PlayerID player_id)
 
bool isFollowingPlayer (PlayerID player_id) const
 
std::vector< PlayerID > getFollowedPlayers () const
 
std::optional< Dilemma > getOpenDilemma () const
 
std::optional< DilemmaEffects > getDilemmaEffects (int option) const
 
bool resolveDilemma (int option)
 
const BoardState & getBoardState () const
 
std::optional< BoardTargets > getBoardTargets () const
 
bool isTransferEmbargoed () const
 
const std::vector< FinanceTransaction > & getFinanceLedger (TeamID team_id) const
 
FinanceSummary getFinanceSummary (TeamID team_id, GameDateValue from, GameDateValue to) const
 
int64_t getWeeklyWageBill (TeamID team_id) const
 
bool moveTransferToWageBudget (int64_t transfer_amount)
 
bool setTicketPrice (uint32_t price)
 
uint32_t getFairTicketPrice (TeamID team_id) const
 
uint32_t getLastHomeAttendance (TeamID team_id) const
 
bool isPlayerAvailable (PlayerID player_id) const
 
std::vector< PlayerID > getInjuredPlayers (TeamID team_id) const
 
std::vector< PlayerID > getUnavailableLineupPlayers (TeamID team_id) const
 
SquadRole getSquadRole (PlayerID player_id) const
 
PotentialEstimate getPotentialEstimate (PlayerID player_id) const
 
bool applyMatchConsequences (PlayerID player_id, uint8_t minutes_played, float end_condition, bool injured)
 
bool renewContract (PlayerID player_id, ContractTerms terms)
 
float getManagerStanding () const
 
std::vector< TalkOptionView > getTalkOptions (PlayerID player_id) const
 
std::optional< TalkOutcome > talkToPlayer (PlayerID player_id, TalkOption option)
 
const PlayerRelation * getPlayerRelation (PlayerID player_id) const
 
std::vector< Promise > getPlayerPromises (PlayerID player_id) const
 
std::vector< Promise > getActivePromises () const
 
std::optional< StoryChoice > getStoryChoice (PlayerID player_id) const
 
bool hasPendingTalk (PlayerID player_id) const
 
TeamTalkContext getTeamTalkContext (TeamTalkMoment moment, int own_goals=0, int other_goals=0) const
 
bool canGiveTeamTalk (TeamTalkMoment moment) const
 
std::optional< TeamTalkResult > giveTeamTalk (TeamTalkMoment moment, TeamTalkTone tone, int own_goals=0, int other_goals=0)
 
float getTeamTalkModifier (TeamID team_id, int half) const
 
float getHumanFactorModifier (TeamID team_id, int half) const
 
DressingRoom getDressingRoom () const
 
PlayerID getSetPieceDesignation (SetPieceDuty duty) const
 
bool setSetPieceDesignation (SetPieceDuty duty, PlayerID player_id)
 
PlayerID getEffectiveSetPieceTaker (SetPieceDuty duty) const
 
void autoPickSetPieces ()
 
std::optional< SquadStatus > getSquadStatus (PlayerID player_id) const
 
SquadStatus getDeservedSquadStatus (PlayerID player_id) const
 
bool setSquadStatus (PlayerID player_id, std::optional< SquadStatus > status)
 
SquadPlan getSquadPlan (int season_offset) const
 
MedicalReport getMedicalReport () const
 
std::vector< AgendaEvent > getSeasonAgenda () const
 
std::optional< ScoutedPlayerView > getScoutedView (PlayerID player_id) const
 
std::optional< ScoutedPlayerRow > getScoutedRow (PlayerID player_id) const
 
std::vector< ScoutedPlayerRow > searchScoutedPlayers (const ScoutSearchFilter &filter) const
 
float getScoutingKnowledge (PlayerID player_id) const
 
std::vector< ScoutProfile > getScouts () const
 
const std::vector< ScoutAssignment > & getScoutAssignments () const
 
int64_t getScoutAssignmentCost (ScoutTargetKind kind, uint32_t target_id, uint16_t days) const
 
ScoutAssignError startScoutAssignment (uint32_t scout_id, ScoutTargetKind kind, uint32_t target_id, uint16_t days)
 
bool cancelScoutAssignment (uint32_t assignment_id)
 
const std::vector< ScoutReport > & getScoutReports () const
 
std::vector< ScoutSummary > getScoutSummaries () const
 
ScoutExpertise getScoutExpertise (uint32_t scout_id) const
 
ScoutEffectiveness getScoutEffectiveness (uint32_t scout_id, ScoutTargetKind kind, uint32_t target_id) const
 
size_t getUnreadScoutReportCount () const
 
bool markScoutReportsSeen (uint32_t scout_id)
 
const std::vector< RecruitmentFocus > & getRecruitmentFocuses () const
 
uint32_t saveRecruitmentFocus (const RecruitmentFocus &focus)
 
bool removeRecruitmentFocus (uint32_t focus_id)
 
const std::vector< ShortlistEntry > & getShortlist () const
 
bool isShortlisted (PlayerID player_id) const
 
bool addToShortlist (PlayerID player_id)
 
bool removeFromShortlist (PlayerID player_id)
 
std::vector< SquadComparisonRow > compareShortlistWithSquad () const
 
const TeamTrainingPlan * getTrainingPlan () const
 
bool setTrainingPreset (TrainingPreset preset)
 
bool setTrainingSlot (MicrocycleDay day, TrainingSlot slot)
 
bool setTrainingIntensity (TrainingIntensity intensity)
 
bool setCongestionAutoAdjust (bool enabled)
 
bool setPlayerTrainingFocus (PlayerID player_id, TrainingFocus focus)
 
PlayerWorkload getPlayerWorkload (PlayerID player_id) const
 
std::vector< TrainingDayPreview > getTrainingWeekPreview () const
 
float getTacticalFamiliarity (TeamID team_id) const
 
std::vector< TrainingAdvice > getTrainingAdvice () const
 
std::vector< const StaffMember * > getStaff (TeamID team_id) const
 
std::vector< const StaffMember * > getStaffMarket () const
 
StaffEffects getStaffEffects (TeamID team_id) const
 
float getScoutingAccuracy (TeamID team_id) const
 
uint32_t getStaffWageDemand (StaffID staff_id) const
 
StaffActionResult hireStaff (StaffID staff_id, uint8_t years)
 
StaffActionResult releaseStaff (StaffID staff_id)
 
StaffActionResult extendStaffContract (StaffID staff_id, uint8_t years)
 
std::vector< YouthPlayerView > getYouthPlayers (YouthStatus status) const
 
std::vector< YouthPlayerView > getYouthEligibleFirstTeam () const
 
bool isAcademyPlayer (PlayerID player_id) const
 
AcademyOverview getAcademyOverview () const
 
std::vector< YouthTableRow > getYouthTable () const
 
const std::vector< YouthResult > & getYouthResults () const
 
UpgradeQuote getAcademyUpgradeQuote (AcademyUpgrade kind) const
 
UpgradeRequestResult requestAcademyUpgrade (AcademyUpgrade kind)
 
YouthActionResult signYouthCandidate (PlayerID player_id)
 
YouthActionResult releaseYouthCandidate (PlayerID player_id)
 
YouthActionResult offerYouthProfessionalContract (PlayerID player_id)
 
YouthActionResult promoteYouthPlayer (PlayerID player_id)
 
YouthActionResult moveToYouthSquad (PlayerID player_id)
 
std::vector< YouthPlayerView > getReserveCandidates () const
 
ReserveOverview getReserveOverview () const
 
std::vector< YouthTableRow > getReserveTable () const
 
const std::vector< YouthResult > & getReserveResults () const
 
YouthActionResult moveToReserves (PlayerID player_id)
 
YouthActionResult promoteReservePlayer (PlayerID player_id)
 
YouthActionResult moveReserveToU18 (PlayerID player_id)
 
bool hasCareer () const
 
bool isUnemployed () const
 
const ManagerProfile * getManagerProfile () const
 
void createManager (const ManagerSetup &setup)
 
const std::vector< ManagerStint > & getManagerStints () const
 
const std::vector< ManagerSeasonLine > & getManagerSeasons () const
 
const std::vector< ManagerAward > & getManagerAwards () const
 
const AiManager * getClubManager (TeamID team_id) const
 
std::vector< VacancyView > getVacancies () const
 
const std::vector< JobApplication > & getJobApplications () const
 
ApplyResult applyForJob (TeamID team_id)
 
std::optional< InterviewResult > attendInterview (TeamID team_id, std::span< const std::uint8_t > answers)
 
const std::vector< JobOffer > & getJobOffers () const
 
OfferReply negotiateJobOffer (std::uint32_t offer_id, int64_t weekly_wage, std::uint8_t years)
 
bool acceptJobOffer (std::uint32_t offer_id)
 
bool declineJobOffer (std::uint32_t offer_id)
 
bool resignFromClub ()
 
int advanceWhileUnemployed (int max_days=7)
 
const NationalJob * getNationalJob () const
 
bool hasNationalJob () const
 
const std::vector< NationalStint > & getNationalJobHistory () const
 
std::vector< NationalVacancyView > getNationalVacancies () const
 
NationalApplyResult applyForNationalJob (Language nation)
 
const std::vector< NationalJobOffer > & getNationalJobOffers () const
 
NationalApplyResult acceptNationalJobOffer (std::uint32_t offer_id)
 
bool declineNationalJobOffer (std::uint32_t offer_id)
 
bool resignNationalJob ()
 
bool canCombineClubAndNation () const
 
CallUpView getCallUpView () const
 
International::CallUpResult setNationalSquad (const std::vector< PlayerID > &players)
 
const OnboardingState & getOnboarding () const
 
bool completeOnboardingTask (OnboardingTask task)
 
void dismissOnboarding ()
 
void showOnboarding ()
 
std::vector< NextAction > getNextActions (size_t limit=5) const
 
const DelegationPolicy & getDelegation () const
 
bool isDelegated (Duty duty) const
 
bool setDutyOwner (Duty duty, DutyOwner owner)
 
void applyDelegationPreset (DelegationPreset preset)
 
const StaffMember * getDelegate () const
 
std::optional< Duty > getReclaimedDuty () const
 
void undoReclaimedDuty ()
 
void dismissReclaimedDuty ()
 
std::optional< NextFixture > getNextManagedFixture () const
 
OppositionReport getOppositionReport (TeamID opponent) const
 
void markOppositionReportViewed (TeamID opponent)
 
bool wasOppositionReportViewed (TeamID opponent) const
 
bool setOppositionInstruction (TeamID opponent, PlayerID player, OppositionInstruction instruction)
 
OppositionInstruction getOppositionInstruction (TeamID opponent, PlayerID player) const
 
std::vector< OppositionOrder > getOppositionInstructions (TeamID opponent) const
 
bool applyCounterTactic (const CounterTactic &counter)
 
DataHubView getDataHub () const
 
std::optional< ManagedMatchSnapshot > getMatchSnapshot (GameDateValue date, TeamID home_id, TeamID away_id) const
 
bool isInboxDecisionPending (const InboxMessage &message) const
 
const std::vector< AwardRecord > & getAwardHistory () const
 
std::vector< AwardRecord > getLeagueAwards (LeagueID league_id, uint16_t season_year) const
 
std::vector< AwardRecord > getPlayerHonours (PlayerID player_id) const
 
std::vector< AwardPlayerTally > getAwardRace (LeagueID league_id, bool young, size_t limit=5) const
 
std::vector< RecordEntry > getClubRecords (TeamID team_id) const
 
std::vector< RecordEntry > getLeagueRecords (LeagueID league_id) const
 
std::vector< ClubPlayerTotal > getClubTopScorers (TeamID team_id, size_t limit=10) const
 
std::vector< ClubPlayerTotal > getClubMostAppearances (TeamID team_id, size_t limit=10) const
 
std::vector< AllTimeRow > getAllTimeTable (LeagueID league_id) const
 
std::vector< LegendEntry > getHallOfFame (TeamID team_id) const
 
ProjectQuote getProjectQuote (FacilityProjectType type, uint32_t seats=0) const
 
ProjectVerdict requestFacilityProject (FacilityProjectType type, uint32_t seats=0)
 
std::vector< FacilityProject > getFacilityProjects () const
 
uint8_t getMedicalLevel (TeamID team_id) const
 
std::optional< GameDateValue > getProjectCooldown (FacilityProjectType type) const
 
std::vector< FriendlySlot > getPreseasonFriendlies () const
 
std::vector< OpponentOption > getFriendlyOpponents (GameDateValue date, OpponentLevel level, bool abroad) const
 
bool setPreseasonFriendly (GameDateValue date, TeamID opponent_id, bool home, bool tour)
 
std::vector< FriendlySuggestion > getPreseasonSuggestion () const
 
size_t applyPreseasonSuggestion ()
 
CampQuote getCampQuote (TrainingCamp camp) const
 
TrainingCamp getSuggestedCamp () const
 
bool bookTrainingCamp (TrainingCamp camp)
 
const PreseasonState & getPreseasonState () const
 
int64_t getTourFee (TeamID opponent_id) const
 
std::vector< MentoringGroup > getMentoringGroups () const
 
MentoringError createMentoringGroup (PlayerID mentor_id, uint32_t *group_id=nullptr)
 
MentoringError addMentee (uint32_t group_id, PlayerID mentee_id)
 
MentoringError removeMentee (uint32_t group_id, PlayerID mentee_id)
 
MentoringError dissolveMentoringGroup (uint32_t group_id)
 
float getMentoringMultiplier (PlayerID player_id) const
 
HolidayPreferences getHolidayPreferences () const
 
void setHolidayPreferences (const HolidayPreferences &preferences)
 
std::optional< GameDateValue > getHolidayTarget (const HolidayPlan &plan) const
 
int goOnHoliday (const HolidayPlan &plan)
 
const HolidaySummary & getHolidaySummary () const
 
uint64_t getWorldSeed () const
 
const Game * getGame () const
 
Game * getGame ()
 
std::shared_ptr< DatabaseConnection > getDbConn () const
 Gets the database connection (for repos that need it).
 
std::shared_ptr< GameData > getGameData () const
 Gets the game data cache.
 
std::shared_ptr< EditorSession > beginEditor ()
 
void cancelEditor ()
 
bool applyEditor (const std::shared_ptr< EditorSession > &session, const std::vector< RuntimeEditor::Change > &changes, std::string &error)
 
bool undoEditor (std::string &error)
 
bool canUndoEditor () const
 
void registerEditorValidator (RuntimeEditor::Validator validator)
 
std::uint64_t getEditorRevision () const
 

Static Public Member Functions

static const char * continueStopKey (ContinueStop stop)
 
static const char * playerActionBlockKey (PlayerActionBlock block)
 

Static Public Attributes

static constexpr int OFF_SEASON_MAX_DAYS = 45
 

Private Member Functions

void replaceEditorDatabase (std::shared_ptr< DatabaseConnection > connection)
 
bool persistLocked (bool autosave)
 
void maybeAutosave ()
 
void startSession (int slot, std::int64_t playtime_seconds)
 
void simulateDay ()
 
bool executeTransfer (PlayerID pid, TeamID buyer_id, TeamID seller_id, uint32_t price, std::optional< ContractTerms > contract=std::nullopt)
 
void processAITransferActivity ()
 
void evaluateIncomingAIBids ()
 
void processOfferReplies ()
 
OfferOutcome answerCounter (std::uint32_t offer_id)
 
OfferOutcome answerLoanCounter (std::uint32_t offer_id)
 
OfferOutcome sendCounter (std::uint32_t offer_id, const TransferNegotiation::OfferTerms &terms, bool firm)
 
bool routeListingBid (PlayerID pid, TeamID bidder_id, uint32_t bid, bool announce=true)
 
void absorbListingBids ()
 
BuyerNegotiation::PlayerStance playerStance (PlayerID pid, TeamID buyer) const
 
void purgeStaleListings ()
 
void clearBidsBy (TeamID team_id)
 
bool completeAiSale (PlayerID pid)
 
uint32_t listingPrice (PlayerID pid) const
 
bool canPayDeal (const TransferMarket::Deal &deal) const
 
bool canPayPreContract (const TransferMarket::Deal &deal) const
 
void runDelegatedDuties ()
 
void reclaimDuty (Duty duty)
 
void recordManagedMatch (GameDateValue date, TeamID home_id, TeamID away_id, const MatchEngine &engine)
 
std::optional< std::reference_wrapper< Team > > managedClub ()
 
std::optional< std::reference_wrapper< const Team > > managedClub () const
 
void syncOppositionOrders ()
 

Private Attributes

std::mutex runtime_mutex
 
std::weak_ptr< EditorSession > editor_session
 
std::shared_ptr< DatabaseConnection > editor_backup
 
std::vector< RuntimeEditor::Validator > editor_validators
 
std::uint64_t editor_revision = 0
 
std::shared_ptr< class DatabaseConnection > db_conn
 
std::unique_ptr< Game > game
 
std::shared_ptr< class GameData > gamedata
 
std::unordered_map< PlayerID, TransferListing > transfer_listings
 
std::mt19937 transfer_rng
 
float last_initialization_milliseconds = 0.0f
 
std::atomic< int > continue_days_started {0}
 
std::atomic< int > continue_days_total {0}
 
std::atomic< bool > continue_stop_requested {false}
 
std::atomic< ContinueStop > last_continue_stop {ContinueStop::None}
 
HolidaySummary holiday_summary
 
std::optional< DelegationPolicy > delegation_after_holiday
 
int current_slot = -1
 
AutosavePolicy autosave_policy
 
GameDateValue last_autosave_date
 
int last_autosave_season = 0
 
std::int64_t playtime_before_session = 0
 
std::chrono::steady_clock::time_point session_started
 
std::optional< SaveError > last_load_error
 
std::mutex club_identity_mutex
 
std::optional< std::unordered_map< TeamID, ClubIdentity > > club_identities
 
std::mutex save_status_mutex
 
SaveStatusInfo save_status
 
std::vector< TeamID > viewed_opposition
 
bool assistant_acting = false
 
std::optional< Duty > reclaimed_duty
 

Detailed Description

Manages the core game logic, interacting with teams, leagues, and players.

This controller holds the central game state and provides methods to retrieve and manipulate game data such as leagues, teams, and the managed team.

Member Enumeration Documentation

◆ OfferOutcome

enum class GameController::OfferOutcome : std::uint8_t
strong

What became of an action on an incoming offer.

Enumerator
Sold 

The player moved (or left on loan).

AwaitingReply 

The buyer answers on a later day.

Countered 

The buyer answered at once (deadline) with terms.

WalkedAway 

The buyer ended the talks.

Rejected 

The club turned the offer down.

TermsRefused 

The clubs agreed but the player would not sign.

SquadTooSmall 

Selling him would break the squad floor.

Failed 

Not possible now (window, budget, player gone).

◆ PlayerActionBlock

enum class GameController::PlayerActionBlock : std::uint8_t
strong

Why an action on a managed player is not possible now.

Enumerator
None 
NotYours 

Not the managed club's (or an academy player).

WindowClosed 

The transfer window is shut.

OnLoan 

Borrowed from another club.

Leaving 

Committed to another club (pre-contract).

SquadFloor 

He would leave fewer than 11 senior players.

LastGoalkeeper 

He is the club's only senior goalkeeper.

MaxLength 

His contract already runs as long as allowed.

NotLonger 

The proposal does not extend his contract.

TooLong 

Longer than the rules allow at his age.

TalksEnded 

He will not talk again for a few days.

SquadFull 

The squad already has the most senior players.

◆ StaffActionResult

enum class GameController::StaffActionResult : uint8_t
strong
Enumerator
Ok 
NoClub 
UnknownStaff 
NotAvailable 

Not on the market / not at the managed club.

RoleFull 

StaffModel::ROLE_LIMITS reached.

CannotAfford 

Cash below 12 weeks of the wage or the severance.

InvalidTerms 

Constructor & Destructor Documentation

◆ GameController()

GameController::GameController ( )
default

Constructs a new GameController.

Member Function Documentation

◆ absorbListingBids()

void GameController::absorbListingBids ( )
private

Listing bids for managed players (older saves) become offers.

◆ acceptBid()

bool GameController::acceptBid ( PlayerID  player_id)

◆ acceptIncomingOffer()

bool GameController::acceptIncomingOffer ( std::uint32_t  offer_id)

settleIncomingOffer() that only reports whether the player moved.

◆ acceptJobOffer()

bool GameController::acceptJobOffer ( std::uint32_t  offer_id)

Takes the job: a manager under contract leaves his club (the new club pays it the release compensation) and every managed-club binding moves.

◆ acceptNationalJobOffer()

NationalApplyResult GameController::acceptNationalJobOffer ( std::uint32_t  offer_id)

Takes the job; refused while a club job cannot be combined with it.

◆ addMentee()

MentoringError GameController::addMentee ( uint32_t  group_id,
PlayerID  mentee_id 
)

◆ addToShortlist()

bool GameController::addToShortlist ( PlayerID  player_id)

◆ advanceDay()

void GameController::advanceDay ( )

Advances the game date by one day.

◆ advanceToNextEvent()

int GameController::advanceToNextEvent ( int  max_days = OFF_SEASON_MAX_DAYS)

Continue with no managed fixture on the calendar (the off-season): days pass until something needs the manager, the first of: news that arrives unread, a bid or job offer, a transfer window opening, the new season, a managed fixture on the calendar, the loss of the job, a stop request or max_days. The reason is in getLastContinueStop().

Returns
Days advanced.

◆ advanceToNextManagedFixture()

int GameController::advanceToNextManagedFixture ( int  max_days = 60)

Advances quiet days and stops on the next managed fixture (early when the job is lost or a stop is requested).

◆ advanceWhileUnemployed()

int GameController::advanceWhileUnemployed ( int  max_days = 7)

Continue while out of work: up to max_days, stopping early when an offer or an interview invitation arrives. Returns the days simulated.

◆ answerCounter()

GameController::OfferOutcome GameController::answerCounter ( std::uint32_t  offer_id)
private

Applies the buyer's answer to the counter of offer offer_id.

◆ answerLoanCounter()

GameController::OfferOutcome GameController::answerLoanCounter ( std::uint32_t  offer_id)
private

Applies the borrower's answer to the loan counter of offer_id.

◆ applyCounterTactic()

bool GameController::applyCounterTactic ( const CounterTactic &  counter)

Adds a counter-tactic's slider changes to the managed tactic.

◆ applyDelegationPreset()

void GameController::applyDelegationPreset ( DelegationPreset  preset)

◆ applyEditor()

bool GameController::applyEditor ( const std::shared_ptr< EditorSession > &  session,
const std::vector< RuntimeEditor::Change > &  changes,
std::string &  error 
)

Contains loader, codec and feature-validator exceptions at the runtime replacement boundary; failures preserve the live career and draft.

◆ applyForJob()

ApplyResult GameController::applyForJob ( TeamID  team_id)

◆ applyForNationalJob()

NationalApplyResult GameController::applyForNationalJob ( Language  nation)

◆ applyMatchConsequences()

bool GameController::applyMatchConsequences ( PlayerID  player_id,
uint8_t  minutes_played,
float  end_condition,
bool  injured 
)

Physical consequences of the live match for one player (call before setMatchResult, once per player and match day). end_condition < 0 lets the simulation estimate drain and roll injuries; otherwise injured reports an engine injury event whose diagnosis is drawn here.

◆ applyPreseasonSuggestion()

size_t GameController::applyPreseasonSuggestion ( )

Applies the assistant's friendlies; returns how many were set.

◆ attendInterview()

std::optional< InterviewResult > GameController::attendInterview ( TeamID  team_id,
std::span< const std::uint8_t >  answers 
)

Answers the interview (one option per InterviewTopic).

◆ autoFixLineup()

size_t GameController::autoFixLineup ( TeamID  team_id,
MatchType  type 
)

Replaces those players with eligible squad members (same role first); returns how many were replaced.

◆ autoPickSetPieces()

void GameController::autoPickSetPieces ( )

Designates every duty from the current XI (the automatic choices).

◆ beginEditor()

std::shared_ptr< GameController::EditorSession > GameController::beginEditor ( )

◆ bookTrainingCamp()

bool GameController::bookTrainingCamp ( TrainingCamp  camp)

◆ buyPlayer()

bool GameController::buyPlayer ( PlayerID  player_id,
TeamID  buyer_id,
uint32_t  price 
)

◆ buyPlayerWithContract()

bool GameController::buyPlayerWithContract ( PlayerID  player_id,
TeamID  buyer_id,
uint32_t  price,
ContractTerms  terms 
)

◆ calculateAttentionScore()

float GameController::calculateAttentionScore ( PlayerID  player_id) const

◆ calculateMaxPrice()

uint32_t GameController::calculateMaxPrice ( PlayerID  player_id,
TeamID  buyer_id,
const SquadNeeds &  needs 
) const

◆ canAffordPlayer() [1/2]

bool GameController::canAffordPlayer ( TeamID  buyer_id,
PlayerID  player_id,
uint32_t  target_price 
) const

◆ canAffordPlayer() [2/2]

bool GameController::canAffordPlayer ( TeamID  buyer_id,
PlayerID  player_id,
uint32_t  target_price,
uint32_t  offered_weekly_wage 
) const

◆ cancelEditor()

void GameController::cancelEditor ( )

◆ cancelScoutAssignment()

bool GameController::cancelScoutAssignment ( uint32_t  assignment_id)

◆ canCombineClubAndNation()

bool GameController::canCombineClubAndNation ( ) const

A club job and a national team together (reputation rule).

◆ canGiveTeamTalk()

bool GameController::canGiveTeamTalk ( TeamTalkMoment  moment) const

False once this moment's talk was given for today's match.

◆ canKickOff()

bool GameController::canKickOff ( TeamID  team_id,
MatchType  type 
) const

The selection may kick off as it is: autoFixLineup() would change nothing, so any ineligible selections left are injured players nobody fit can replace (they play through it).

◆ canPayDeal()

bool GameController::canPayDeal ( const TransferMarket::Deal &  deal) const
private

Signing-day cash of a deal fits the buyer's transfer budget and the new wage its wage budget.

◆ canPayPreContract()

bool GameController::canPayPreContract ( const TransferMarket::Deal &  deal) const
private

A pre-contract's wage fits next season's wage room and its bonus and agent fee the transfer money not yet committed.

◆ canRecallLoan()

bool GameController::canRecallLoan ( PlayerID  player_id) const

True when recallLoan() would succeed today.

◆ canSignFreeAgentFor()

bool GameController::canSignFreeAgentFor ( TeamID  club) const

True when club may sign a player without a club today: any day in most countries, only in and shortly after the windows in some.

◆ canUndoEditor()

bool GameController::canUndoEditor ( ) const
inline

◆ clearBidsBy()

void GameController::clearBidsBy ( TeamID  team_id)
private

Withdraws the bids a club placed while it had no manager.

◆ compareShortlistWithSquad()

std::vector< SquadComparisonRow > GameController::compareShortlistWithSquad ( ) const

Own depth per position against the best shortlisted estimate.

◆ completeAiSale()

bool GameController::completeAiSale ( PlayerID  pid)
private

AI seller accepts the highest bid as a structured deal.

◆ completeOnboardingTask()

bool GameController::completeOnboardingTask ( OnboardingTask  task)

Ticks a checklist step; false when it was already done.

◆ continueStopKey()

const char * GameController::continueStopKey ( ContinueStop  stop)
static

Language key explaining stop (e.g. "CONTINUE_STOP_MESSAGE").

◆ counterIncomingOffer()

GameController::OfferOutcome GameController::counterIncomingOffer ( std::uint32_t  offer_id,
const TransferNegotiation::OfferTerms &  terms 
)

Proposes a full structure to the bidder. It answers in a day or two (the same day near the deadline): accepts, counters or walks away.

◆ counterLoanOffer()

GameController::OfferOutcome GameController::counterLoanOffer ( std::uint32_t  offer_id,
const TransferNegotiation::LoanTerms &  terms 
)

Proposes loan terms (wage share, length, option or obligation to buy, recall clause, guaranteed appearances) to the club that wants to borrow the player. It answers like a buyer: later, the same day near the deadline, with its own terms, or by walking away.

◆ counterOffer()

bool GameController::counterOffer ( PlayerID  player_id,
uint32_t  new_price 
)

◆ createManager()

void GameController::createManager ( const ManagerSetup &  setup)

Creates the manager; the career starts without a club until selectManagedTeam() or an accepted job offer.

◆ createMentoringGroup()

MentoringError GameController::createMentoringGroup ( PlayerID  mentor_id,
uint32_t *  group_id = nullptr 
)

◆ declareNotForSale()

bool GameController::declareNotForSale ( std::uint32_t  offer_id)

Rejects every bid for the offer's player and tells the clubs he is not for sale until the window closes.

◆ declineJobOffer()

bool GameController::declineJobOffer ( std::uint32_t  offer_id)

◆ declineNationalJobOffer()

bool GameController::declineNationalJobOffer ( std::uint32_t  offer_id)

◆ deleteSave()

bool GameController::deleteSave ( int  slot) const

Deletes a slot with its backups (not the loaded one).

◆ dismissOnboarding()

void GameController::dismissOnboarding ( )

Hides the checklist (Help and Settings can bring it back).

◆ dismissReclaimedDuty()

void GameController::dismissReclaimedDuty ( )
inline

◆ dissolveMentoringGroup()

MentoringError GameController::dissolveMentoringGroup ( uint32_t  group_id)

◆ evaluateAndActForTeam()

void GameController::evaluateAndActForTeam ( TeamID  team_id)

◆ evaluateIncomingAIBids()

void GameController::evaluateIncomingAIBids ( )
private

◆ evaluateSquadNeeds()

GameController::SquadNeeds GameController::evaluateSquadNeeds ( TeamID  team_id) const

◆ executeTransfer()

bool GameController::executeTransfer ( PlayerID  pid,
TeamID  buyer_id,
TeamID  seller_id,
uint32_t  price,
std::optional< ContractTerms >  contract = std::nullopt 
)
private

◆ exerciseLoanOption()

bool GameController::exerciseLoanOption ( PlayerID  player_id)

Buys a player on loan at the managed club for the option fee.

◆ extendStaffContract()

GameController::StaffActionResult GameController::extendStaffContract ( StaffID  staff_id,
uint8_t  years 
)

Extends a contract to years remaining seasons (2-5) at the renewal wage.

◆ findTargetsForRole()

std::vector< PlayerID > GameController::findTargetsForRole ( PlayerRole  role,
TeamID  buyer_id,
const SquadNeeds &  needs 
) const

◆ followPlayer()

bool GameController::followPlayer ( PlayerID  player_id)

Followed players: inbox news about their moves, injuries, big matches, honours and new contracts. Following fails for unknown or already followed players and beyond Stories::MAX_FOLLOWS.

◆ getAcademyOverview()

GameController::AcademyOverview GameController::getAcademyOverview ( ) const

◆ getAcademyUpgradeQuote()

UpgradeQuote GameController::getAcademyUpgradeQuote ( AcademyUpgrade  kind) const

Next step of an academy investment and the board's answer today.

◆ getActivePromises()

std::vector< Promise > GameController::getActivePromises ( ) const

Active promises to managed players, soonest deadline first.

◆ getAgentDemands()

PlayerAgent::Demands GameController::getAgentDemands ( PlayerID  player_id,
TransferNegotiation::ContractKind  kind,
std::uint8_t  years 
) const

What the player's agent asks for in the open contract talks, the package priced for years.

◆ getAgentOpeningLine()

const char * GameController::getAgentOpeningLine ( PlayerID  player_id,
TransferNegotiation::ContractKind  kind 
) const

The agent's line as contract talks of kind open.

◆ getAgentPurchaseLine()

const char * GameController::getAgentPurchaseLine ( PlayerID  player_id,
const TransferNegotiation::ClubResponse &  response 
) const

The agent's line after the selling club answered the club's offer.

◆ getAllListings()

const std::unordered_map< PlayerID, TransferListing > & GameController::getAllListings ( ) const

◆ getAllTimeTable()

std::vector< AllTimeRow > GameController::getAllTimeTable ( LeagueID  league_id) const

◆ getArchivedPlacing()

std::optional< std::pair< LeagueID, uint16_t > > GameController::getArchivedPlacing ( uint16_t  season,
TeamID  team_id 
) const

League and final position of a club in a past season.

◆ getArchivedSeasons()

std::vector< uint16_t > GameController::getArchivedSeasons ( LeagueID  league_id) const

Seasons with an archived final table of league_id, newest first.

◆ getArchivedTable()

const std::vector< StandingRow > * GameController::getArchivedTable ( uint16_t  season,
LeagueID  league_id 
) const

Final table of a past season (nullptr if it was not archived).

◆ getAssistantFixesLineup()

bool GameController::getAssistantFixesLineup ( ) const

◆ getAutosavePolicy()

AutosavePolicy GameController::getAutosavePolicy ( ) const

◆ getAwardHistory()

const std::vector< AwardRecord > & GameController::getAwardHistory ( ) const

Every league honour given so far, oldest first.

◆ getAwardRace()

std::vector< AwardPlayerTally > GameController::getAwardRace ( LeagueID  league_id,
bool  young,
size_t  limit = 5 
) const

Current season award race of a league (qualified players first, then by the award score); young keeps players up to 21.

◆ getBoardState()

const BoardState & GameController::getBoardState ( ) const

Objective, expected/target position, confidence (0-100), dismissal.

◆ getBoardTargets()

std::optional< GameController::BoardTargets > GameController::getBoardTargets ( ) const

Targets of the managed club's board (nullopt without a club).

◆ getCallUpView()

GameController::CallUpView GameController::getCallUpView ( ) const

◆ getCampQuote()

CampQuote GameController::getCampQuote ( TrainingCamp  camp) const

◆ getClubIdentity()

const ClubIdentity * GameController::getClubIdentity ( TeamID  team_id) const

Descriptive identity of a club from the data pack (short code, kit colours, stadium, founding year, nickname). Loaded once on first use and cached; UI thread only.

Returns
nullptr when the pack has no entry for this club.

◆ getClubManager()

const AiManager * GameController::getClubManager ( TeamID  team_id) const

AI manager of a club (nullptr for the managed club and vacancies).

◆ getClubMostAppearances()

std::vector< ClubPlayerTotal > GameController::getClubMostAppearances ( TeamID  team_id,
size_t  limit = 10 
) const

◆ getClubRecords()

std::vector< RecordEntry > GameController::getClubRecords ( TeamID  team_id) const

◆ getClubTopScorers()

std::vector< ClubPlayerTotal > GameController::getClubTopScorers ( TeamID  team_id,
size_t  limit = 10 
) const

◆ getContinental()

const ContinentalCompetitions * GameController::getContinental ( ) const

Continental club competitions (nullptr without a game).

◆ getContinentalTieScore()

ContinentalCompetitions::TieScore GameController::getContinentalTieScore ( LeagueID  competition_id,
const ContinentalCompetitions::Tie &  tie 
) const

Aggregate score of a continental knockout tie.

◆ getContinueProgress()

GameController::ContinueProgress GameController::getContinueProgress ( ) const

Thread-safe snapshot for a progress bar: poll it from the UI thread while Continue runs on a worker thread.

◆ getContractDemand()

GameController::ContractTerms GameController::getContractDemand ( PlayerID  player_id,
bool  free_agent 
) const

◆ getContractRoundsLeft()

std::uint8_t GameController::getContractRoundsLeft ( PlayerID  player_id) const

Proposals the player will still consider.

◆ getContractTalkKind()

std::optional< TransferNegotiation::ContractKind > GameController::getContractTalkKind ( PlayerID  player_id) const

Kind of contract talks the managed club can hold with a player now: agreed transfer, free agent or pre-contract (final six months).

◆ getCupIds()

std::vector< LeagueID > GameController::getCupIds ( ) const

Domestic cup IDs: the top league ID of each country.

◆ getCupName()

std::string GameController::getCupName ( LeagueID  cup_id) const

◆ getCupStatus()

std::optional< Competitions::CupStatus > GameController::getCupStatus ( LeagueID  cup_id) const

◆ getCurrentDate()

GameDateValue GameController::getCurrentDate ( ) const

Gets the current date in the game.

Returns
The current game date.

◆ getCurrentSeason()

int GameController::getCurrentSeason ( ) const

Gets the current season year.

Returns
The current season as an integer.

◆ getCurrentSlot()

std::optional< int > GameController::getCurrentSlot ( ) const

Slot of the loaded career.

◆ getDataHub()

GameController::DataHubView GameController::getDataHub ( ) const

◆ getDbConn()

std::shared_ptr< DatabaseConnection > GameController::getDbConn ( ) const
inline

Gets the database connection (for repos that need it).

◆ getDelegate()

const StaffMember * GameController::getDelegate ( ) const

Staff member acting for the manager (assistant, else best coach).

◆ getDelegation()

const DelegationPolicy & GameController::getDelegation ( ) const

Who handles each duty of the managed club.

◆ getDeservedSquadStatus()

SquadStatus GameController::getDeservedSquadStatus ( PlayerID  player_id) const

Status the player's ability rank in his squad earns in his own eyes.

◆ getDilemmaEffects()

std::optional< DilemmaEffects > GameController::getDilemmaEffects ( int  option) const

What answer option (0 or 1) of the open moment would do.

◆ getDressingRoom()

DressingRoom GameController::getDressingRoom ( ) const

Leaders, cliques, cohesion, mood, requests and promises.

◆ getEditorRevision()

std::uint64_t GameController::getEditorRevision ( ) const
inline

Number of successful runtime replacements; used to invalidate UI caches.

◆ getEffectiveSetPieceTaker()

PlayerID GameController::getEffectiveSetPieceTaker ( SetPieceDuty  duty) const

Who performs a duty at the next kick-off: the designated player when he starts, else the automatic choice among the XI (captain: the highest dressing-room standing, vice-captain: the next one). 0 without an XI.

◆ getFacilityProjects()

std::vector< FacilityProject > GameController::getFacilityProjects ( ) const

Managed club's projects, running first.

◆ getFairTicketPrice()

uint32_t GameController::getFairTicketPrice ( TeamID  team_id) const

Reference price at which the club meets its league's gate target.

◆ getFinanceLedger()

const std::vector< FinanceTransaction > & GameController::getFinanceLedger ( TeamID  team_id) const

Dated transactions of a club, oldest first (empty if unknown).

◆ getFinanceSummary()

FinanceSummary GameController::getFinanceSummary ( TeamID  team_id,
GameDateValue  from,
GameDateValue  to 
) const

Per-category income/expense totals for transactions in [from, to].

◆ getFollowedPlayers()

std::vector< PlayerID > GameController::getFollowedPlayers ( ) const

◆ getFriendlyOpponents()

std::vector< OpponentOption > GameController::getFriendlyOpponents ( GameDateValue  date,
OpponentLevel  level,
bool  abroad 
) const

◆ getGame() [1/2]

Game * GameController::getGame ( )
inline

◆ getGame() [2/2]

const Game * GameController::getGame ( ) const
inline

◆ getGameData()

std::shared_ptr< GameData > GameController::getGameData ( ) const
inline

Gets the game data cache.

◆ getHallOfFame()

std::vector< LegendEntry > GameController::getHallOfFame ( TeamID  team_id) const

◆ getHolidayPreferences()

HolidayPreferences GameController::getHolidayPreferences ( ) const

◆ getHolidaySummary()

const HolidaySummary & GameController::getHolidaySummary ( ) const
inline

◆ getHolidayTarget()

std::optional< GameDateValue > GameController::getHolidayTarget ( const HolidayPlan &  plan) const

Day a plan would end on (nullopt: open-ended or nothing to wait for); "next match" means the next fixture after today.

◆ getHumanFactorModifier()

float GameController::getHumanFactorModifier ( TeamID  team_id,
int  half 
) const

Team talks plus squad cohesion, capped at +-2% (FR-119, FR-123).

◆ getInbox()

const std::vector< InboxMessage > & GameController::getInbox ( ) const

Managed club's messages, oldest first. Display text via InboxMessage::formatTitle() / formatBody().

◆ getInboxView()

InboxView GameController::getInboxView ( ) const

Saved filters of the inbox screen (kept with the career).

◆ getIncomingOffers()

const std::vector< IncomingOffer > & GameController::getIncomingOffers ( ) const

AI offers for the managed club's players (loans included). Bids of AI clubs on the club's listed players arrive here too.

◆ getIncomingOfferView()

std::optional< GameController::IncomingOfferView > GameController::getIncomingOfferView ( std::uint32_t  offer_id) const

◆ getIneligibleSelections()

std::vector< PlayerID > GameController::getIneligibleSelections ( TeamID  team_id,
MatchType  type 
) const

Selected players (XI and reserves) injured or suspended for type.

◆ getInjuredPlayers()

std::vector< PlayerID > GameController::getInjuredPlayers ( TeamID  team_id) const

Injured players of a club.

◆ getInternationalDuty()

std::optional< Language > GameController::getInternationalDuty ( PlayerID  player_id) const

Nation a player is called up by (announced or away) today.

◆ getInternationalRecord()

const International::Record * GameController::getInternationalRecord ( PlayerID  player_id) const

Caps, goals and finals matches of a player; nullptr when uncapped.

◆ getJobApplications()

const std::vector< JobApplication > & GameController::getJobApplications ( ) const

◆ getJobOffers()

const std::vector< JobOffer > & GameController::getJobOffers ( ) const

◆ getKnockoutRules()

std::optional< MatchRules::Knockout > GameController::getKnockoutRules ( GameDateValue  date,
TeamID  home_id,
TeamID  away_id 
) const

Knockout rules of a fixture for the engine that plays it (extra time and penalties, aggregate of the first leg); nullopt for matches that may end drawn or unknown fixtures.

◆ getLastContinueStop()

ContinueStop GameController::getLastContinueStop ( ) const
inline

Why the latest run stopped (read once it has finished).

◆ getLastHomeAttendance()

uint32_t GameController::getLastHomeAttendance ( TeamID  team_id) const

Crowd of the club's latest home match this session (0 if none).

◆ getLastInitializationMilliseconds()

float GameController::getLastInitializationMilliseconds ( ) const
inline

Duration of the most recent load/new-game initialization.

◆ getLastLoadError()

const std::optional< SaveError > & GameController::getLastLoadError ( ) const
inline

Why the last loadGame() failed (FutureVersion, Corrupt, Incomplete, Missing); empty after a successful load.

◆ getLeagueAttentionMultiplier()

float GameController::getLeagueAttentionMultiplier ( LeagueID  league_id) const

◆ getLeagueAwards()

std::vector< AwardRecord > GameController::getLeagueAwards ( LeagueID  league_id,
uint16_t  season_year 
) const

Honours of a league in a season, in award order.

◆ getLeagueById()

std::optional< std::reference_wrapper< const League > > GameController::getLeagueById ( uint8_t  league_id) const

Gets a league by its ID.

Parameters
league_idThe ID of the league.
Returns
An optional reference wrapper to the league.

◆ getLeagueRecords()

std::vector< RecordEntry > GameController::getLeagueRecords ( LeagueID  league_id) const

◆ getLeagues()

const std::vector< std::reference_wrapper< const League > > & GameController::getLeagues ( ) const

Gets all leagues available in the game.

Returns
A vector of constant reference wrappers to the leagues.

◆ getLeagueTier()

uint8_t GameController::getLeagueTier ( LeagueID  league_id) const

1 = top division, 2 = second division, ...

◆ getListingBlock()

GameController::PlayerActionBlock GameController::getListingBlock ( PlayerID  player_id) const

Why the player cannot be transfer-listed now.

◆ getListingsByRole()

std::vector< const TransferListing * > GameController::getListingsByRole ( PlayerRole  role) const

◆ getListingsExcludingTeam()

std::vector< const TransferListing * > GameController::getListingsExcludingTeam ( TeamID  team_id) const

◆ getManagedTeam() [1/2]

std::optional< std::reference_wrapper< Team > > GameController::getManagedTeam ( )

Gets the team currently managed by the player (mutable).

Returns
An optional reference wrapper to the managed Team.

◆ getManagedTeam() [2/2]

std::optional< std::reference_wrapper< const Team > > GameController::getManagedTeam ( ) const

Gets the team currently managed by the player (read-only).

Returns
An optional reference wrapper to the managed Team (const).

◆ getManagerAwards()

const std::vector< ManagerAward > & GameController::getManagerAwards ( ) const

◆ getManagerProfile()

const ManagerProfile * GameController::getManagerProfile ( ) const

nullptr before the manager step.

◆ getManagerSeasons()

const std::vector< ManagerSeasonLine > & GameController::getManagerSeasons ( ) const

◆ getManagerStanding()

float GameController::getManagerStanding ( ) const

The manager's standing with the players, 0-100: board confidence blended with the club's reputation (there is no manager reputation).

◆ getManagerStints()

const std::vector< ManagerStint > & GameController::getManagerStints ( ) const

◆ getMatchReport()

std::optional< MatchReport > GameController::getMatchReport ( GameDateValue  date,
TeamID  home_id,
TeamID  away_id 
) const

◆ getMatchSnapshot()

std::optional< ManagedMatchSnapshot > GameController::getMatchSnapshot ( GameDateValue  date,
TeamID  home_id,
TeamID  away_id 
) const

Tracked data (shots, touch maps, pass network) of a managed club's match, if it was recorded.

◆ getMedicalLevel()

uint8_t GameController::getMedicalLevel ( TeamID  team_id) const

Medical centre level of a club (50 = standard).

◆ getMedicalReport()

MedicalReport GameController::getMedicalReport ( ) const

Injuries, fitness, injury risk and the medical staff of the club.

◆ getMentoringGroups()

std::vector< MentoringGroup > GameController::getMentoringGroups ( ) const

◆ getMentoringMultiplier()

float GameController::getMentoringMultiplier ( PlayerID  player_id) const

Development multiplier a player gets from his mentor (1.0 = none).

◆ getNationalJob()

const NationalJob * GameController::getNationalJob ( ) const

The manager's national-team job (nullptr when he has none).

◆ getNationalJobHistory()

const std::vector< NationalStint > & GameController::getNationalJobHistory ( ) const

◆ getNationalJobOffers()

const std::vector< NationalJobOffer > & GameController::getNationalJobOffers ( ) const

◆ getNationalTeams()

const NationalTeams * GameController::getNationalTeams ( ) const

National teams: calendar, squads, finals, ratings (nullptr without a game).

◆ getNationalVacancies()

std::vector< GameController::NationalVacancyView > GameController::getNationalVacancies ( ) const

Open national jobs, best chance first.

◆ getNextActions()

std::vector< NextAction > GameController::getNextActions ( size_t  limit = 5) const

Pending work of the managed club, most important first.

◆ getNextManagedFixture()

std::optional< GameController::NextFixture > GameController::getNextManagedFixture ( ) const

◆ getOnboarding()

const OnboardingState & GameController::getOnboarding ( ) const

First-week checklist of the career.

◆ getOpenDilemma()

std::optional< Dilemma > GameController::getOpenDilemma ( ) const

The open decision moment of the managed club, if any.

◆ getOppositionInstruction()

OppositionInstruction GameController::getOppositionInstruction ( TeamID  opponent,
PlayerID  player 
) const

◆ getOppositionInstructions()

std::vector< OppositionOrder > GameController::getOppositionInstructions ( TeamID  opponent) const

Instructions against opponent (for the match engine).

◆ getOppositionReport()

OppositionReport GameController::getOppositionReport ( TeamID  opponent) const

Opponent's form, likely XI (scouted estimates only), strengths, weaknesses and counter-tactics.

◆ getPlayerCareer()

std::vector< PlayerSeasonStats > GameController::getPlayerCareer ( PlayerID  player_id) const

◆ getPlayerDemand()

TransferNegotiation::ContractDemand GameController::getPlayerDemand ( PlayerID  player_id,
TransferNegotiation::ContractKind  kind 
) const

The player's demands for talks of kind with the managed club; asking_wage is the agent's current ask in these talks.

◆ getPlayerHonours()

std::vector< AwardRecord > GameController::getPlayerHonours ( PlayerID  player_id) const

Honours of a player, newest first (profile honours section).

◆ getPlayerMarketValue()

uint32_t GameController::getPlayerMarketValue ( PlayerID  player_id) const

◆ getPlayerPromises()

std::vector< Promise > GameController::getPlayerPromises ( PlayerID  player_id) const

Promises made to a player, newest first (resolved ones for a year).

◆ getPlayerRelation()

const PlayerRelation * GameController::getPlayerRelation ( PlayerID  player_id) const

nullptr when the manager and player have no history.

◆ getPlayerSeasonStats()

std::vector< PlayerSeasonStats > GameController::getPlayerSeasonStats ( PlayerID  player_id) const

◆ getPlayersForTeam()

const std::vector< std::reference_wrapper< const Player > > & GameController::getPlayersForTeam ( uint16_t  team_id) const

Gets the players belonging to a specific team.

Parameters
team_idThe ID of the team.
Returns
A vector of constant reference wrappers to the players.

◆ getPlayerWorkload()

GameController::PlayerWorkload GameController::getPlayerWorkload ( PlayerID  player_id) const

Focus, workload and development trend of a player.

◆ getPotentialEstimate()

GameController::PotentialEstimate GameController::getPotentialEstimate ( PlayerID  player_id) const

Scouted potential range (the scouting view's range; see below).

◆ getPreseasonFriendlies()

std::vector< FriendlySlot > GameController::getPreseasonFriendlies ( ) const

◆ getPreseasonState()

const PreseasonState & GameController::getPreseasonState ( ) const

◆ getPreseasonSuggestion()

std::vector< FriendlySuggestion > GameController::getPreseasonSuggestion ( ) const

The assistant's friendlies for the editable dates.

◆ getProjectCooldown()

std::optional< GameDateValue > GameController::getProjectCooldown ( FacilityProjectType  type) const

Day a refused project type may be asked for again.

◆ getProjectQuote()

ProjectQuote GameController::getProjectQuote ( FacilityProjectType  type,
uint32_t  seats = 0 
) const

Quote for the managed club (seats only matter for stadiums).

◆ getReclaimedDuty()

std::optional< Duty > GameController::getReclaimedDuty ( ) const
inline

A duty the manager took back by changing it by hand (training plan, cancelled scouting trip, friendly); shown with an undo until dismissed.

◆ getRecruitmentFocuses()

const std::vector< RecruitmentFocus > & GameController::getRecruitmentFocuses ( ) const

◆ getReleaseBlock()

GameController::PlayerActionBlock GameController::getReleaseBlock ( PlayerID  player_id) const

Why the player cannot be released now (None if he can).

◆ getReleaseClause()

uint32_t GameController::getReleaseClause ( PlayerID  player_id) const

Release clause in a player's contract (0 = none).

◆ getReleaseCost()

int64_t GameController::getReleaseCost ( PlayerID  player_id) const

Remaining wages owed if a managed player is released today.

◆ getRenewalBlock()

GameController::PlayerActionBlock GameController::getRenewalBlock ( PlayerID  player_id) const

Why the player's contract cannot be renewed now.

◆ getReserveCandidates()

std::vector< GameController::YouthPlayerView > GameController::getReserveCandidates ( ) const

U21 candidates of the managed club: first-team players up to 21 and the over-age ones up to 24 (status Graduated), U18 players from 17 (status Squad).

◆ getReserveOverview()

GameController::ReserveOverview GameController::getReserveOverview ( ) const

◆ getReserveResults()

const std::vector< YouthResult > & GameController::getReserveResults ( ) const

Managed club's U21 results this season, oldest first.

◆ getReserveTable()

std::vector< YouthTableRow > GameController::getReserveTable ( ) const

The country's U21 league, leader first.

◆ getRoleCategory()

PlayerRole GameController::getRoleCategory ( PlayerRole  role) const

◆ getSaleBlock()

GameController::PlayerActionBlock GameController::getSaleBlock ( PlayerID  player_id) const

Why the player cannot be sold or loaned out now.

◆ getSaveBackups()

std::vector< SaveBackup > GameController::getSaveBackups ( int  slot) const

Previous saves and pre-upgrade copies of a slot, newest first.

◆ getSaveSlotMetadata()

GameController::SaveSlotMetadata GameController::getSaveSlotMetadata ( int  slot) const

Gets metadata for a save slot.

◆ getSaveStatus()

GameController::SaveStatusInfo GameController::getSaveStatus ( ) const

Latest save result; safe to poll from the UI thread during Continue.

◆ getScoutAssignmentCost()

int64_t GameController::getScoutAssignmentCost ( ScoutTargetKind  kind,
uint32_t  target_id,
uint16_t  days 
) const

Price of an assignment; 0 if the target is invalid.

◆ getScoutAssignments()

const std::vector< ScoutAssignment > & GameController::getScoutAssignments ( ) const

◆ getScoutedRow()

std::optional< ScoutedPlayerRow > GameController::getScoutedRow ( PlayerID  player_id) const

Compact estimate (overall, potential range, value, knowledge).

◆ getScoutedView()

std::optional< ScoutedPlayerView > GameController::getScoutedView ( PlayerID  player_id) const

Estimated attributes, overall, potential range and knowledge (0-100); exact values only for the managed club's own players.

◆ getScoutEffectiveness()

ScoutEffectiveness GameController::getScoutEffectiveness ( uint32_t  scout_id,
ScoutTargetKind  kind,
uint32_t  target_id 
) const

Expected effectiveness (0.6x-1.5x) with its breakdown.

◆ getScoutExpertise()

ScoutExpertise GameController::getScoutExpertise ( uint32_t  scout_id) const

Nationality, languages and league experience of a scout.

◆ getScoutingAccuracy()

float GameController::getScoutingAccuracy ( TeamID  team_id) const

Scouting accuracy of a club in [0, 1], from its scouts' judging attributes and network size. Discrimination d' = 0.8 + 1.3 * accuracy; StaffModel::potentialErrorSd() converts it to the standard deviation of a potential estimate in overall points.

◆ getScoutingKnowledge()

float GameController::getScoutingKnowledge ( PlayerID  player_id) const

Managed club's knowledge of a player, 0-100.

◆ getScoutReports()

const std::vector< ScoutReport > & GameController::getScoutReports ( ) const

Scout reports, oldest first.

◆ getScouts()

std::vector< ScoutProfile > GameController::getScouts ( ) const

◆ getScoutSummaries()

std::vector< ScoutSummary > GameController::getScoutSummaries ( ) const

Scouts with status (on assignment / idle with history / new) and report counters, in roster order.

◆ getSeasonAgenda()

std::vector< AgendaEvent > GameController::getSeasonAgenda ( ) const

Dated events of the managed club's current season.

◆ getSeasonHistory()

const std::vector< SeasonHistoryEntry > & GameController::getSeasonHistory ( ) const

◆ getSeasonStartYear()

uint16_t GameController::getSeasonStartYear ( uint16_t  season) const

Calendar year season started in (0 if not archived).

◆ getSetPieceDesignation()

PlayerID GameController::getSetPieceDesignation ( SetPieceDuty  duty) const

Player designated for a duty in the managed lineup (0 = automatic).

◆ getShortlist()

const std::vector< ShortlistEntry > & GameController::getShortlist ( ) const

◆ getSquadPlan()

SquadPlan GameController::getSquadPlan ( int  season_offset) const

Depth chart, needs, age profile and contracts of the managed squad for this season (0) or a projected later one (1 = next season).

◆ getSquadRole()

SquadRole GameController::getSquadRole ( PlayerID  player_id) const

Playing-time expectation from the player's ability rank.

◆ getSquadStatus()

std::optional< SquadStatus > GameController::getSquadStatus ( PlayerID  player_id) const

Status the manager gave a managed player (nullopt: none given).

◆ getStaff()

std::vector< const StaffMember * > GameController::getStaff ( TeamID  team_id) const

Staff of a club by role, best first.

◆ getStaffEffects()

StaffEffects GameController::getStaffEffects ( TeamID  team_id) const

What a club's staff does for the squad.

◆ getStaffMarket()

std::vector< const StaffMember * > GameController::getStaffMarket ( ) const

Unattached staff, best first.

◆ getStaffWageDemand()

uint32_t GameController::getStaffWageDemand ( StaffID  staff_id) const

Weekly wage a candidate asks for (market) or to extend (own staff).

◆ getStandings()

std::vector< StandingRow > GameController::getStandings ( LeagueID  league_id) const

Fixture-derived table: points, GD, goals, head-to-head, name, ID.

◆ getStatsConfig()

const StatsConfig & GameController::getStatsConfig ( ) const

Gets the configuration settings for player stats.

Returns
A reference to the StatsConfig.

◆ getStoryChoice()

std::optional< StoryChoice > GameController::getStoryChoice ( PlayerID  player_id) const

Open story decision for a player (transfer saga, captain dispute).

◆ getSuggestedCamp()

TrainingCamp GameController::getSuggestedCamp ( ) const

◆ getSuspendedPlayers()

std::vector< DisciplinaryRecord > GameController::getSuspendedPlayers ( TeamID  team_id) const

Players of a team with an outstanding suspension.

◆ getSuspensionMatches()

uint8_t GameController::getSuspensionMatches ( PlayerID  player_id,
MatchType  scope 
) const

Matches still to serve in league or cup (0 = eligible).

◆ getTacticalFamiliarity()

float GameController::getTacticalFamiliarity ( TeamID  team_id) const

Tactical familiarity in [0, 1]; see TrainingSystem::tacticalFamiliarity.

◆ getTalkOptions()

std::vector< TalkOptionView > GameController::getTalkOptions ( PlayerID  player_id) const

Conversation options for a managed player: availability, cooldowns and the predicted reaction.

◆ getTeamById()

std::optional< std::reference_wrapper< const Team > > GameController::getTeamById ( uint16_t  team_id) const

Gets a team by its ID.

Parameters
team_idThe ID of the team.
Returns
An optional reference wrapper to the team.

◆ getTeamFixtures()

std::vector< Match > GameController::getTeamFixtures ( TeamID  team_id) const

All fixtures (league, cup, friendly) of a team this season by date.

◆ getTeams()

const std::vector< std::reference_wrapper< const Team > > & GameController::getTeams ( ) const

Gets all teams available in the game.

Returns
A vector of constant reference wrappers to the teams.

◆ getTeamsInLeague()

std::vector< std::reference_wrapper< const Team > > GameController::getTeamsInLeague ( uint8_t  league_id) const

Gets the teams belonging to a specific league.

Parameters
league_idThe ID of the league.
Returns
A vector of constant reference wrappers to the teams in the league.

◆ getTeamTalkContext()

TeamTalkContext GameController::getTeamTalkContext ( TeamTalkMoment  moment,
int  own_goals = 0,
int  other_goals = 0 
) const

Situation of the managed club's team talk for today's fixture.

◆ getTeamTalkModifier()

float GameController::getTeamTalkModifier ( TeamID  team_id,
int  half 
) const

Execution-quality hint of today's team talks for half (1 or 2), within +-1.2%. For the match engine; nothing reads it yet.

◆ getTopScorers()

std::vector< PlayerSeasonStats > GameController::getTopScorers ( MatchType  competition_type,
LeagueID  competition_id,
size_t  limit = 10 
) const

◆ getTourFee()

int64_t GameController::getTourFee ( TeamID  opponent_id) const

Net fee of a tour match against opponent_id.

◆ getTrainingAdvice()

std::vector< TrainingAdvice > GameController::getTrainingAdvice ( ) const

Assistant manager's recommendations, most important first.

◆ getTrainingPlan()

const TeamTrainingPlan * GameController::getTrainingPlan ( ) const

Managed club's training plan (nullptr without a managed club).

◆ getTrainingWeekPreview()

std::vector< GameController::TrainingDayPreview > GameController::getTrainingWeekPreview ( ) const

The managed club's next seven days (today first) as scheduled.

◆ getTransferWindow()

TransferNegotiation::WindowInfo GameController::getTransferWindow ( ) const

The managed club's transfer window today (deadline countdown).

◆ getTransferWindowFor()

TransferNegotiation::WindowInfo GameController::getTransferWindowFor ( TeamID  club) const

Transfer window of club's country today.

◆ getUnavailableLineupPlayers()

std::vector< PlayerID > GameController::getUnavailableLineupPlayers ( TeamID  team_id) const

Selected players (XI and reserves) who are currently unavailable.

◆ getUnreadInboxCount()

size_t GameController::getUnreadInboxCount ( ) const

◆ getUnreadScoutReportCount()

size_t GameController::getUnreadScoutReportCount ( ) const

Scout reports not yet opened on their scout's page.

◆ getUnseenSeasonReview()

const SeasonReview * GameController::getUnseenSeasonReview ( ) const

The latest season summary not shown yet (nullptr when none).

◆ getVacancies()

std::vector< GameController::VacancyView > GameController::getVacancies ( ) const

Open jobs, best chance first.

◆ getWeeklyWageBill()

int64_t GameController::getWeeklyWageBill ( TeamID  team_id) const

Current weekly payroll of a club.

◆ getWorldSeed()

uint64_t GameController::getWorldSeed ( ) const

Seed of the current world.

◆ getYouthEligibleFirstTeam()

std::vector< GameController::YouthPlayerView > GameController::getYouthEligibleFirstTeam ( ) const

First-team players of the managed club young enough for the U18s.

◆ getYouthPlayers()

std::vector< GameController::YouthPlayerView > GameController::getYouthPlayers ( YouthStatus  status) const

Managed club's academy players with status, best prospect first.

◆ getYouthResults()

const std::vector< YouthResult > & GameController::getYouthResults ( ) const

Managed club's U18 results this season, oldest first.

◆ getYouthTable()

std::vector< YouthTableRow > GameController::getYouthTable ( ) const

U18 league of the managed club, leader first.

◆ giveTeamTalk()

std::optional< TeamTalkResult > GameController::giveTeamTalk ( TeamTalkMoment  moment,
TeamTalkTone  tone,
int  own_goals = 0,
int  other_goals = 0 
)

Gives the talk to the selected XI (once per moment and match).

◆ goOnHoliday()

int GameController::goOnHoliday ( const HolidayPlan &  plan)

Simulates days on the Continue machinery (progress in getContinueProgress()) with the assistant in charge, until the plan's target or an early stop; the report is in getHolidaySummary().

Returns
Days advanced.

◆ hasCareer()

bool GameController::hasCareer ( ) const

A manager exists (created in the new-game step, or for older saves).

◆ hasNationalJob()

bool GameController::hasNationalJob ( ) const

◆ hasPendingTalk()

bool GameController::hasPendingTalk ( PlayerID  player_id) const

True when the player waits for an answer (request or story).

◆ hasSelectedTeam()

bool GameController::hasSelectedTeam ( ) const

Checks if a team has been selected to be managed.

Returns
True if a team is selected, false otherwise.

◆ hasSquadRoom()

bool GameController::hasSquadRoom ( ) const

True when the managed squad has room for one more senior player.

◆ hireStaff()

GameController::StaffActionResult GameController::hireStaff ( StaffID  staff_id,
uint8_t  years 
)

Hires a market candidate for years seasons (1-4).

◆ isAcademyPlayer()

bool GameController::isAcademyPlayer ( PlayerID  player_id) const

True for U18 players and intake trialists (they are not first-team players of their club).

◆ isContinueStopRequested()

bool GameController::isContinueStopRequested ( ) const
inline

◆ isContractOfferAcceptable()

bool GameController::isContractOfferAcceptable ( PlayerID  player_id,
bool  free_agent,
ContractTerms  terms 
) const

◆ isDelegated()

bool GameController::isDelegated ( Duty  duty) const

True when the assistant handles duty (systems check this).

◆ isFollowingPlayer()

bool GameController::isFollowingPlayer ( PlayerID  player_id) const

◆ isGameLoaded()

bool GameController::isGameLoaded ( ) const

Checks if a game is currently loaded.

◆ isInboxDecisionPending()

bool GameController::isInboxDecisionPending ( const InboxMessage &  message) const

A decision message still waits for the manager (offer, player request, youth trialists, decision moment).

◆ isPlayerAvailable()

bool GameController::isPlayerAvailable ( PlayerID  player_id) const

False while injured.

◆ isPlayerListed()

bool GameController::isPlayerListed ( PlayerID  player_id) const

◆ isShortlisted()

bool GameController::isShortlisted ( PlayerID  player_id) const

◆ isTransferEmbargoed()

bool GameController::isTransferEmbargoed ( ) const

True while the board freezes the managed club's transfers because its cash stayed negative (after a warning): no signings, loans or free agents until the balance is positive again; transferBudgetForTeam() is then 0.

◆ isTransferWindowOpen()

bool GameController::isTransferWindowOpen ( ) const

True while the managed club's country has its transfer window open (the managed club can sign players from other clubs).

◆ isTransferWindowOpenAnywhere()

bool GameController::isTransferWindowOpenAnywhere ( ) const

True while some country's window is open, so the managed club may still sell to a club whose window is open.

◆ isTransferWindowOpenFor()

bool GameController::isTransferWindowOpenFor ( TeamID  club) const

True while club can sign players from other clubs: the buying club's window decides (TransferWindows).

◆ isUnemployed()

bool GameController::isUnemployed ( ) const

The career runs without a club: Continue advances time, the inbox and the Job Centre work, club screens and commands are closed.

◆ listingPrice()

uint32_t GameController::listingPrice ( PlayerID  pid) const
private

Asking price of a live listing by the player's club (0 if none).

◆ listPlayerForTransfer()

void GameController::listPlayerForTransfer ( PlayerID  player_id,
uint32_t  asking_price 
)

◆ loadGame()

bool GameController::loadGame ( int  slot)

Loads an existing game from the given save slot.

Returns
True if loaded successfully, false otherwise.

◆ makeLoanOffer()

TransferNegotiation::ClubResponse GameController::makeLoanOffer ( PlayerID  player_id,
const TransferNegotiation::LoanTerms &  terms 
)

Loan offer for another club's player; starts the loan on agreement.

◆ makeTransferOffer()

TransferNegotiation::ClubResponse GameController::makeTransferOffer ( PlayerID  player_id,
const TransferNegotiation::OfferTerms &  terms 
)

Offer of the managed club for another club's player. An accepted fee opens contract talks with the player for a week.

◆ managedClub() [1/2]

std::optional< std::reference_wrapper< Team > > GameController::managedClub ( )
private

The managed club, only once one has been selected.

◆ managedClub() [2/2]

std::optional< std::reference_wrapper< const Team > > GameController::managedClub ( ) const
private

◆ markAllInboxMessagesRead()

void GameController::markAllInboxMessagesRead ( )

◆ markInboxMessageRead()

bool GameController::markInboxMessageRead ( uint32_t  message_id)

Marks one message read; false if the id is unknown.

◆ markOppositionReportViewed()

void GameController::markOppositionReportViewed ( TeamID  opponent)

Remembers (for this session) that the report was read.

◆ markScoutReportsSeen()

bool GameController::markScoutReportsSeen ( uint32_t  scout_id)

Marks a scout's reports as opened.

◆ markSeasonReviewSeen()

void GameController::markSeasonReviewSeen ( uint16_t  season)

◆ maybeAutosave()

void GameController::maybeAutosave ( )
private

◆ moveReserveToU18()

YouthActionResult GameController::moveReserveToU18 ( PlayerID  player_id)

A U21 player aged 18 or younger goes back to the U18s.

◆ moveToReserves()

YouthActionResult GameController::moveToReserves ( PlayerID  player_id)

A first-team or U18 player joins the U21 squad.

◆ moveToYouthSquad()

YouthActionResult GameController::moveToYouthSquad ( PlayerID  player_id)

Moves a first-team player aged 18 or younger to the U18 squad.

◆ moveTransferToWageBudget()

bool GameController::moveTransferToWageBudget ( int64_t  transfer_amount)

Moves money between the managed club's budgets (52 weeks per season): positive moves transfer budget into weekly wages, negative moves unused wage room back. False if a budget would become insufficient.

◆ nameAskingPrice()

GameController::OfferOutcome GameController::nameAskingPrice ( std::uint32_t  offer_id,
uint32_t  price 
)

Lists the player at price and gives the bidder that figure as a take-it-or-leave-it price (it meets it, makes its final offer or leaves).

◆ negotiateJobOffer()

OfferReply GameController::negotiateJobOffer ( std::uint32_t  offer_id,
int64_t  weekly_wage,
std::uint8_t  years 
)

◆ newGame()

void GameController::newGame ( int  slot,
std::optional< std::uint64_t >  world_seed = std::nullopt 
)

Starts a new game on the given save slot.

Parameters
world_seedSeed of the generated world and of every random stream of the world simulation. Without it FM_WORLD_SEED or the clock is used.

◆ offerYouthProfessionalContract()

YouthActionResult GameController::offerYouthProfessionalContract ( PlayerID  player_id)

Turns a scholarship into a first professional contract.

◆ payReleaseClause()

TransferNegotiation::ClubResponse GameController::payReleaseClause ( PlayerID  player_id)

Pays another club's player's release clause in cash: the selling club cannot refuse, and contract talks with the player open. Fails over budget, out of the window or without a clause.

◆ persistLocked()

bool GameController::persistLocked ( bool  autosave)
private

Flushes the game and atomically replaces the slot file. Caller must hold runtime_mutex, including autosaves during advancement.

◆ playerActionBlockKey()

const char * GameController::playerActionBlockKey ( PlayerActionBlock  block)
static

Language key explaining block (empty for None).

◆ playerStance()

BuyerNegotiation::PlayerStance GameController::playerStance ( PlayerID  pid,
TeamID  buyer 
) const
private

How a managed player feels about joining buyer.

◆ previewLineupFix()

std::vector< std::pair< PlayerID, PlayerID > > GameController::previewLineupFix ( TeamID  team_id,
MatchType  type 
) const

What autoFixLineup() would change: (replaced, replacement or 0 when the player just leaves the matchday squad).

◆ processAITransferActivity()

void GameController::processAITransferActivity ( )
private

◆ processOfferReplies()

void GameController::processOfferReplies ( )
private

Buyers' answers to the club's counters that are due today.

◆ promoteReservePlayer()

YouthActionResult GameController::promoteReservePlayer ( PlayerID  player_id)

A U21 player joins the first-team squad.

◆ promoteYouthPlayer()

YouthActionResult GameController::promoteYouthPlayer ( PlayerID  player_id)

Moves a U18 player up to the first-team squad.

◆ proposeContract()

GameController::ContractTalkResult GameController::proposeContract ( PlayerID  player_id,
const TransferNegotiation::ContractOffer &  offer 
)

Proposes personal terms; completes the move (or the renewal of a managed player's contract) when the player and his agent agree. A renewal's years count the current season: it must extend the contract.

◆ purgeStaleListings()

void GameController::purgeStaleListings ( )
private

Drops listings of players who moved, left or may not be traded.

◆ randomFloat()

float GameController::randomFloat ( float  min,
float  max 
)
inline

◆ recallLoan()

bool GameController::recallLoan ( PlayerID  player_id)

Recalls a loaned-out player (recall clause, open window, at least Loan::RECALL_MIN_DAYS into the loan).

◆ reclaimDuty()

void GameController::reclaimDuty ( Duty  duty)
private

A manual change of something the assistant owns hands it back.

◆ recordManagedMatch()

void GameController::recordManagedMatch ( GameDateValue  date,
TeamID  home_id,
TeamID  away_id,
const MatchEngine &  engine 
)
private

Match snapshot and checklist after a managed live match.

◆ registerEditorValidator()

void GameController::registerEditorValidator ( RuntimeEditor::Validator  validator)

◆ rejectBid()

bool GameController::rejectBid ( PlayerID  player_id)

◆ rejectIncomingOffer()

bool GameController::rejectIncomingOffer ( std::uint32_t  offer_id)

Turns the offer down; a player keen on the move takes it badly.

◆ releasePlayer()

bool GameController::releasePlayer ( PlayerID  player_id)

Terminates a managed player's contract, paying the remaining wages.

◆ releaseStaff()

GameController::StaffActionResult GameController::releaseStaff ( StaffID  staff_id)

Releases a managed staff member, paying StaffModel::severance().

◆ releaseYouthCandidate()

YouthActionResult GameController::releaseYouthCandidate ( PlayerID  player_id)

Lets a trialist go.

◆ removeFromShortlist()

bool GameController::removeFromShortlist ( PlayerID  player_id)

◆ removeMentee()

MentoringError GameController::removeMentee ( uint32_t  group_id,
PlayerID  mentee_id 
)

◆ removePlayerFromTransfer()

void GameController::removePlayerFromTransfer ( PlayerID  player_id)

◆ removeRecruitmentFocus()

bool GameController::removeRecruitmentFocus ( uint32_t  focus_id)

◆ renewContract()

bool GameController::renewContract ( PlayerID  player_id,
ContractTerms  terms 
)

Extends a managed player's contract to terms.years seasons (the current one included) if he and his agent accept the terms, as one round of the renewal talks.

◆ replaceEditorDatabase()

void GameController::replaceEditorDatabase ( std::shared_ptr< DatabaseConnection >  connection)
private

◆ requestAcademyUpgrade()

UpgradeRequestResult GameController::requestAcademyUpgrade ( AcademyUpgrade  kind)

Asks the board to fund the next step (cost booked when approved).

◆ requestContinueStop()

void GameController::requestContinueStop ( )
inline

Asks the running Continue, holiday or off-season jump to stop at the end of the day being simulated. Thread-safe; each run clears the request when it starts.

◆ requestFacilityProject()

ProjectVerdict GameController::requestFacilityProject ( FacilityProjectType  type,
uint32_t  seats = 0 
)

Asks the board to fund a project for the managed club.

◆ resignFromClub()

bool GameController::resignFromClub ( )

Leaves the managed club without compensation.

◆ resignNationalJob()

bool GameController::resignNationalJob ( )

◆ resolveDilemma()

bool GameController::resolveDilemma ( int  option)

Answers the open decision moment; false if none is open.

◆ restoreBackup()

bool GameController::restoreBackup ( int  slot,
const std::filesystem::path &  backup 
)

Replaces the slot with one of its backups (the replaced file is kept aside, never deleted) and loads it; unsaved progress of a loaded career in that slot is discarded.

◆ routeListingBid()

bool GameController::routeListingBid ( PlayerID  pid,
TeamID  bidder_id,
uint32_t  bid,
bool  announce = true 
)
private

An AI club's bid on a listed managed player becomes an offer the manager can negotiate.

◆ runDelegatedDuties()

void GameController::runDelegatedDuties ( )
private

The assistant's delegated daily jobs (after each simulated day).

◆ saveGame()

bool GameController::saveGame ( )

Saves the current state of the game to its slot.

The slot file is replaced atomically by a verified snapshot and the previous one kept as a backup; on failure (disk full, read-only folder) the previous save is untouched. Never throws.

Returns
False on failure; details in getSaveStatus().

◆ saveRecruitmentFocus()

uint32_t GameController::saveRecruitmentFocus ( const RecruitmentFocus &  focus)

Adds (id 0) or updates a focus; returns its id, 0 on failure.

◆ searchScoutedPlayers()

std::vector< ScoutedPlayerRow > GameController::searchScoutedPlayers ( const ScoutSearchFilter &  filter) const

Player search on estimated values, best estimate first.

◆ selectManagedTeam()

void GameController::selectManagedTeam ( uint16_t  team_id)

Selects the team for the player to manage.

Parameters
team_idThe ID of the team to select.

◆ sendCounter()

GameController::OfferOutcome GameController::sendCounter ( std::uint32_t  offer_id,
const TransferNegotiation::OfferTerms &  terms,
bool  firm 
)
private

◆ setAssistantFixesLineup()

void GameController::setAssistantFixesLineup ( bool  enabled)

Assistant keeps the managed lineup eligible (each day and at kick-off; on by default, kept for the session).

◆ setAutosavePolicy()

void GameController::setAutosavePolicy ( const AutosavePolicy &  policy)

When the game saves on its own and how many backups a slot keeps.

◆ setCongestionAutoAdjust()

bool GameController::setCongestionAutoAdjust ( bool  enabled)

Collapses weeks with two matches to recovery and activation only.

◆ setDutyOwner()

bool GameController::setDutyOwner ( Duty  duty,
DutyOwner  owner 
)

Changes one duty (fixed duties refuse).

◆ setHolidayPreferences()

void GameController::setHolidayPreferences ( const HolidayPreferences &  preferences)

◆ setInboxView()

void GameController::setInboxView ( const InboxView &  view)

◆ setLoanListed()

bool GameController::setLoanListed ( PlayerID  player_id,
bool  listed 
)

Offers (or withdraws) a managed player for loan.

◆ setMatchResult() [1/2]

bool GameController::setMatchResult ( GameDateValue  date,
uint16_t  home_id,
uint16_t  away_id,
const MatchEngine &  engine 
)

Records a managed match with the structured summary of the live engine (team stats, per-player lines and the measured condition and injuries, applied like for simulated matches). A knockout engine brings its extra time and shootout; a tie still level is settled statistically.

◆ setMatchResult() [2/2]

bool GameController::setMatchResult ( GameDateValue  date,
uint16_t  home_id,
uint16_t  away_id,
uint8_t  home_score,
uint8_t  away_score 
)

◆ setNationalSquad()

International::CallUpResult GameController::setNationalSquad ( const std::vector< PlayerID > &  players)

Replaces the announced squad of the managed nation.

◆ setOppositionInstruction()

bool GameController::setOppositionInstruction ( TeamID  opponent,
PlayerID  player,
OppositionInstruction  instruction 
)

Instruction against an opposing player for the next meeting.

◆ setPlayerTrainingFocus()

bool GameController::setPlayerTrainingFocus ( PlayerID  player_id,
TrainingFocus  focus 
)

Individual training focus of a managed player.

◆ setPreseasonFriendly()

bool GameController::setPreseasonFriendly ( GameDateValue  date,
TeamID  opponent_id,
bool  home,
bool  tour 
)

◆ setSetPieceDesignation()

bool GameController::setSetPieceDesignation ( SetPieceDuty  duty,
PlayerID  player_id 
)

Designates a managed player for a duty (0 = automatic). Goalkeepers cannot take kicks or throws; false when the player is not allowed.

◆ setSimulationThreads()

void GameController::setSimulationThreads ( unsigned  threads)

Threads simulating a matchday in the current game (1 = sequential).

◆ setSquadNumber()

SquadNumbers::Change GameController::setSquadNumber ( PlayerID  player_id,
int  number 
)

Gives a senior player of the managed club squad number number (1-99); a teammate wearing it takes the player's old number. Other clubs' players and academy players are refused (Invalid).

◆ setSquadStatus()

bool GameController::setSquadStatus ( PlayerID  player_id,
std::optional< SquadStatus >  status 
)

Gives a managed player a status (nullopt clears it). It sets his playing-time expectation (getSquadRole(), never more than one level below his standing; see SquadStatusModel::expectation()) for morale, requests and contract talks. Prospect is only for players up to SquadStatusModel::PROSPECT_MAX_AGE.

◆ setTicketPrice()

bool GameController::setTicketPrice ( uint32_t  price)

Sets the managed club's average ticket price (1-1000).

◆ settleIncomingOffer()

GameController::OfferOutcome GameController::settleIncomingOffer ( std::uint32_t  offer_id)

Accepts the bid on the table: the player agrees personal terms with the buyer (or, rarely, refuses) and the sale completes.

◆ setTrainingIntensity()

bool GameController::setTrainingIntensity ( TrainingIntensity  intensity)

Squad-wide intensity applied on top of the session intensities.

◆ setTrainingPreset()

bool GameController::setTrainingPreset ( TrainingPreset  preset)

Applies a preset's template (Custom keeps the current days).

◆ setTrainingSlot()

bool GameController::setTrainingSlot ( MicrocycleDay  day,
TrainingSlot  slot 
)

Changes one day of the managed club's template (preset -> Custom).

◆ showOnboarding()

void GameController::showOnboarding ( )

Shows a hidden checklist again.

◆ signFreeAgent()

bool GameController::signFreeAgent ( PlayerID  player_id,
TeamID  buyer_id 
)

◆ signFreeAgentWithContract()

bool GameController::signFreeAgentWithContract ( PlayerID  player_id,
TeamID  buyer_id,
ContractTerms  terms 
)

◆ signYouthCandidate()

YouthActionResult GameController::signYouthCandidate ( PlayerID  player_id)

Offers a trialist a scholarship or, from the first professional contract age, a professional contract.

◆ simulateDay()

void GameController::simulateDay ( )
private

One day of simulation plus the AI transfer activity that follows.

◆ startScoutAssignment()

ScoutAssignError GameController::startScoutAssignment ( uint32_t  scout_id,
ScoutTargetKind  kind,
uint32_t  target_id,
uint16_t  days 
)

Sends a scout (cost booked to the ledger today).

◆ startSession()

void GameController::startSession ( int  slot,
std::int64_t  playtime_seconds 
)
private

◆ submitBid()

bool GameController::submitBid ( PlayerID  player_id,
TeamID  bidder_id,
uint32_t  bid_amount 
)

◆ syncOppositionOrders()

void GameController::syncOppositionOrders ( )
private

Copies the opposition plan into the managed club's tactics, which carry it into every match engine (live or simulated).

◆ talkToPlayer()

std::optional< TalkOutcome > GameController::talkToPlayer ( PlayerID  player_id,
TalkOption  option 
)

Holds one conversation line (morale, trust, promises, requests). Accepting a transfer request also lists the player at his market value. Answers the player's open story, if any. nullopt when the option is not available.

◆ transferBudgetForTeam()

uint32_t GameController::transferBudgetForTeam ( TeamID  team_id) const

Transfer money the club can commit today (the "available budget" to show): min(board allowance, cash - 12 weeks of payroll - instalments owed this season), never negative, 0 while embargoed.

◆ undoEditor()

bool GameController::undoEditor ( std::string &  error)

◆ undoReclaimedDuty()

void GameController::undoReclaimedDuty ( )

Hands the reclaimed duty back to the assistant.

◆ unfollowPlayer()

bool GameController::unfollowPlayer ( PlayerID  player_id)

◆ wasOppositionReportViewed()

bool GameController::wasOppositionReportViewed ( TeamID  opponent) const

Member Data Documentation

◆ assistant_acting

bool GameController::assistant_acting = false
private

Set while the assistant changes things on the manager's behalf.

◆ autosave_policy

AutosavePolicy GameController::autosave_policy
private

◆ club_identities

std::optional<std::unordered_map<TeamID, ClubIdentity> > GameController::club_identities
mutableprivate

Data-pack club identities, read on the first getClubIdentity().

◆ club_identity_mutex

std::mutex GameController::club_identity_mutex
mutableprivate

◆ continue_days_started

std::atomic<int> GameController::continue_days_started {0}
private

◆ continue_days_total

std::atomic<int> GameController::continue_days_total {0}
private

◆ continue_stop_requested

std::atomic<bool> GameController::continue_stop_requested {false}
private

◆ current_slot

int GameController::current_slot = -1
private

◆ db_conn

std::shared_ptr<class DatabaseConnection> GameController::db_conn
private

◆ delegation_after_holiday

std::optional<DelegationPolicy> GameController::delegation_after_holiday
private

The manager's own delegation while a holiday hands extra duties to the assistant: saves made on holiday store this one.

◆ editor_backup

std::shared_ptr<DatabaseConnection> GameController::editor_backup
private

◆ editor_revision

std::uint64_t GameController::editor_revision = 0
private

◆ editor_session

std::weak_ptr<EditorSession> GameController::editor_session
private

◆ editor_validators

std::vector<RuntimeEditor::Validator> GameController::editor_validators
private

◆ game

std::unique_ptr<Game> GameController::game
private

◆ gamedata

std::shared_ptr<class GameData> GameController::gamedata
private

◆ holiday_summary

HolidaySummary GameController::holiday_summary
private

◆ last_autosave_date

GameDateValue GameController::last_autosave_date
private

◆ last_autosave_season

int GameController::last_autosave_season = 0
private

◆ last_continue_stop

std::atomic<ContinueStop> GameController::last_continue_stop {ContinueStop::None}
private

◆ last_initialization_milliseconds

float GameController::last_initialization_milliseconds = 0.0f
private

◆ last_load_error

std::optional<SaveError> GameController::last_load_error
private

◆ OFF_SEASON_MAX_DAYS

constexpr int GameController::OFF_SEASON_MAX_DAYS = 45
staticconstexpr

Longest off-season stretch one Continue simulates.

◆ playtime_before_session

std::int64_t GameController::playtime_before_session = 0
private

◆ reclaimed_duty

std::optional<Duty> GameController::reclaimed_duty
private

◆ runtime_mutex

std::mutex GameController::runtime_mutex
mutableprivate

◆ save_status

SaveStatusInfo GameController::save_status
private

◆ save_status_mutex

std::mutex GameController::save_status_mutex
mutableprivate

◆ session_started

std::chrono::steady_clock::time_point GameController::session_started
private

◆ transfer_listings

std::unordered_map<PlayerID, TransferListing> GameController::transfer_listings
private

◆ transfer_rng

std::mt19937 GameController::transfer_rng
private

◆ viewed_opposition

std::vector<TeamID> GameController::viewed_opposition
private

Opponents whose report was opened this session.


The documentation for this class was generated from the following files: