|
Player12
An open source football management simulator
|
Academies of every club: yearly intake cycle, U18 and U21 squads and their leagues, youth contracts and board-funded academy projects. More...
#include <youth_academy.h>
Classes | |
| struct | YouthMatchSheet |
| struct | YouthRound |
Public Member Functions | |
| YouthAcademy (std::shared_ptr< GameData > gamedata) | |
| void | ensureReady () |
| void | setLoanCheck (std::function< bool(PlayerID)> is_on_loan) |
| void | onDayAdvanced (const GameDateValue &date, TeamID managed_team_id, Inbox &inbox) |
| void | onSeasonEnd (const GameDateValue &date, TeamID managed_team_id) |
| void | onSeasonStart (const GameDateValue &date, TeamID managed_team_id, Inbox &inbox) |
| float | developmentMultiplier (const Player &player) const |
| void | load (const std::shared_ptr< DatabaseConnection > &db_conn) |
| void | save (const std::shared_ptr< DatabaseConnection > &db_conn) const |
| const YouthRecord * | record (PlayerID player_id) const |
| bool | isAcademyPlayer (PlayerID player_id) const |
| std::vector< const YouthRecord * > | members (TeamID team_id, YouthStatus status) const |
| const AcademyClub * | club (TeamID team_id) const |
| IntakeInputs | intakeInputs (TeamID team_id) const |
| AcademyRatings | ratings (TeamID team_id) const |
| HeadOfYouth | headOfYouth (TeamID team_id) const |
| IntakePreview | preview (TeamID team_id, std::uint16_t year) const |
| YouthEstimate | estimate (TeamID viewer, PlayerID player_id) const |
| std::vector< YouthTableRow > | table (LeagueID league_id) const |
| const std::vector< YouthResult > & | results () const |
| std::vector< YouthTableRow > | reserveTable (TeamID team_id) const |
| const std::vector< YouthResult > & | reserveResults () const |
| ReserveQuota | reserveQuota (TeamID team_id) const |
| bool | isHomegrown (PlayerID player_id) const |
| std::size_t | firstTeamSize (TeamID team_id) const |
| std::uint32_t | contractWage (TeamID team_id, const Player &player, YouthContract contract) const |
| UpgradeQuote | quote (TeamID team_id, AcademyUpgrade kind, const GameDateValue &date, float board_confidence, bool embargoed) const |
| YouthActionResult | signCandidate (TeamID team_id, PlayerID player_id) |
| YouthActionResult | releaseCandidate (TeamID team_id, PlayerID player_id) |
| YouthActionResult | offerProfessional (TeamID team_id, PlayerID player_id) |
| YouthActionResult | promote (TeamID team_id, PlayerID player_id) |
| YouthActionResult | demote (TeamID team_id, PlayerID player_id) |
| YouthActionResult | moveToReserves (TeamID team_id, PlayerID player_id) |
| YouthActionResult | promoteReserve (TeamID team_id, PlayerID player_id) |
| YouthActionResult | reserveToU18 (TeamID team_id, PlayerID player_id) |
| UpgradeRequestResult | requestUpgrade (const GameDateValue &date, TeamID team_id, AcademyUpgrade kind, float board_confidence, bool embargoed, Inbox &inbox) |
Private Member Functions | |
| void | bootstrap () |
| void | syncFlags () |
| void | leaveFootball (TeamID team_id, PlayerID player_id) |
| void | promoteComputerAcademies (TeamID managed_team_id) |
| void | processComputerAcademyPlayer (TeamID team_id, PlayerID player_id, float overall, float level, std::size_t &seniors, std::size_t &reserve_size, std::vector< PlayerID > &leaving) |
| AcademyClub & | clubState (TeamID team_id) |
| void | prune () |
| void | postPreview (const GameDateValue &date, TeamID managed_team_id, Inbox &inbox) const |
| void | runIntake (const GameDateValue &date, TeamID managed_team_id, Inbox &inbox) |
| void | processIntakeTeam (const GameDateValue &date, TeamID team_id, TeamID managed_team_id, std::uint64_t seed, const StatsConfig &config, NameRegistry &names, Inbox &inbox, std::unordered_map< TeamID, int > &u18_sizes) |
| PlayerID | materializeIntakeCandidate (TeamID team_id, bool managed, Language country, const CandidateProfile &profile, const StatsConfig &config, NameRegistry &names, SquadSurnames &surnames, WorldRng &rng) |
| void | closeDecisions (const GameDateValue &date, TeamID managed_team_id, Inbox &inbox) |
| void | remindDecisions (const GameDateValue &date, TeamID managed_team_id, Inbox &inbox) const |
| void | playMatchday (const GameDateValue &date, TeamID managed_team_id) |
| void | playReserveMatchday (const GameDateValue &date, TeamID managed_team_id) |
| void | playRound (const YouthRound &round) |
| void | playGroup (const YouthRound &round, const std::vector< TeamID > &group, std::int32_t round_number, std::uint16_t season, const StatsConfig &config, std::unordered_map< TeamID, YouthMatchSheet > &sheets) |
| void | playMatch (const YouthRound &round, TeamID home, TeamID away, const StatsConfig &config, std::unordered_map< TeamID, YouthMatchSheet > &sheets) |
| void | recordMatchSide (const YouthRound &round, TeamID team_id, TeamID opponent_id, bool home, YouthMatchSheet &sheet, int scored, int conceded, WorldRng &rng, const StatsConfig &config) |
| void | setUpReserves (TeamID managed_team_id) |
| void | fillComputerReserves (TeamID team_id) |
| void | fillComputerSeniors (TeamID team_id) |
| void | advanceReserves (TeamID managed_team_id, std::vector< std::string > &to_first_team) |
| void | processReservePlayer (bool managed, float level, PlayerID player_id, ReserveQuota &kept, std::size_t &seniors, std::vector< PlayerID > &leaving, std::vector< std::string > &to_first_team) |
| void | enterReserves (const Player &player, YouthRecord &youth) |
| void | completeProjects (const GameDateValue &date, TeamID managed_team_id, Inbox &inbox) |
| void | snapshotProgress (const GameDateValue &date, TeamID managed_team_id) |
| void | applyContract (Player &player, YouthRecord &record, YouthContract contract) const |
| bool | deservesProfessional (TeamID team_id, const Player &player) const |
| double | wageScale (TeamID team_id) const |
| float | judgingSd (TeamID team_id) const |
| std::string | headName (TeamID team_id) const |
Private Attributes | |
| std::shared_ptr< GameData > | gamedata |
| std::unordered_map< PlayerID, YouthRecord > | records |
| std::unordered_map< TeamID, AcademyClub > | clubs |
| std::vector< YouthResult > | managed_results |
| std::vector< YouthResult > | managed_reserve_results |
| std::function< bool(PlayerID)> | loan_check |
| bool | ready = false |
| bool | reserves_checked = false |
Academies of every club: yearly intake cycle, U18 and U21 squads and their leagues, youth contracts and board-funded academy projects.
Calendar (every club, same rules): the head of youth development previews the intake on 1 February, candidates arrive on 15 March and the manager has 30 days to offer contracts; computer-managed clubs sign their best prospects on intake day. U18 teams play a cheap aggregate league every week of the season; minutes and junior coaching speed up development. U21 (reserve) squads hold players aged 21 or younger plus a few over-age players; they are listed apart from the senior squad like the U18s and play one cheap league per country midweek.
|
explicit |
|
private |
Season start: U21 players beyond the age rules move on.
|
private |
|
private |
|
private |
| const AcademyClub * YouthAcademy::club | ( | TeamID | team_id | ) | const |
|
private |
|
private |
| std::uint32_t YouthAcademy::contractWage | ( | TeamID | team_id, |
| const Player & | player, | ||
| YouthContract | contract | ||
| ) | const |
Weekly wage of an academy contract for player at team_id.
| YouthActionResult YouthAcademy::demote | ( | TeamID | team_id, |
| PlayerID | player_id | ||
| ) |
Computer-managed clubs' first professional contracts: old enough and judged among the club's best prospects.
| float YouthAcademy::developmentMultiplier | ( | const Player & | player | ) | const |
Development multiplier of a U18 or U21 player (1 for everyone else): youth match minutes replace first-team minutes, junior coaching and youth facilities replace the senior set-up. Bounded to [0.8, 1.6].
| void YouthAcademy::ensureReady | ( | ) |
Assigns existing young players to U18 squads once (new worlds).
|
private |
Joins the U21 squad; resets the season's youth statistics.
| YouthEstimate YouthAcademy::estimate | ( | TeamID | viewer, |
| PlayerID | player_id | ||
| ) | const |
Scouted ranges of a player as judged by viewer's academy staff.
|
private |
Young senior players outside a computer-managed club's plans join its U21 squad while the senior squad stays at its target size.
|
private |
A computer-managed senior squad below its target size takes its best U21 players and professional-age U18 players up to that size.
| std::size_t YouthAcademy::firstTeamSize | ( | TeamID | team_id | ) | const |
Players of a club's senior squad (academy players excluded).
|
private |
| HeadOfYouth YouthAcademy::headOfYouth | ( | TeamID | team_id | ) | const |
| IntakeInputs YouthAcademy::intakeInputs | ( | TeamID | team_id | ) | const |
| bool YouthAcademy::isAcademyPlayer | ( | PlayerID | player_id | ) | const |
In a U18 or U21 squad, or a trialist of his current club.
| bool YouthAcademy::isHomegrown | ( | PlayerID | player_id | ) | const |
|
private |
Removes a youngster from the world: he drops out of professional football (released trialists and scholars nobody keeps).
| void YouthAcademy::load | ( | const std::shared_ptr< DatabaseConnection > & | db_conn | ) |
|
private |
| std::vector< const YouthRecord * > YouthAcademy::members | ( | TeamID | team_id, |
| YouthStatus | status | ||
| ) | const |
Records of a club with status, sorted by player id.
| YouthActionResult YouthAcademy::moveToReserves | ( | TeamID | team_id, |
| PlayerID | player_id | ||
| ) |
A first-team or U18 player joins the U21 squad (age rules and the over-age places apply).
| YouthActionResult YouthAcademy::offerProfessional | ( | TeamID | team_id, |
| PlayerID | player_id | ||
| ) |
| void YouthAcademy::onDayAdvanced | ( | const GameDateValue & | date, |
| TeamID | managed_team_id, | ||
| Inbox & | inbox | ||
| ) |
Daily: previews, intake day, decision deadline, U18 matchdays, projects and monthly progress snapshots.
| void YouthAcademy::onSeasonEnd | ( | const GameDateValue & | date, |
| TeamID | managed_team_id | ||
| ) |
Before ageing and contract expiry: computer-managed clubs renew the academy players they want to keep.
| void YouthAcademy::onSeasonStart | ( | const GameDateValue & | date, |
| TeamID | managed_team_id, | ||
| Inbox & | inbox | ||
| ) |
After ageing: new U18 and U21 leagues; over-age U18 players move up to the U21s, U21 players beyond the over-age places to the first team.
|
private |
|
private |
|
private |
|
private |
|
private |
One round of a youth league for every group of clubs: team sheets from the players with status, stand-ins of stand_in ability for short sheets, results in row_of and the managed club's results.
|
private |
| IntakePreview YouthAcademy::preview | ( | TeamID | team_id, |
| std::uint16_t | year | ||
| ) | const |
What the head of youth development expects from year's intake.
|
private |
|
private |
|
private |
| YouthActionResult YouthAcademy::promote | ( | TeamID | team_id, |
| PlayerID | player_id | ||
| ) |
|
private |
| YouthActionResult YouthAcademy::promoteReserve | ( | TeamID | team_id, |
| PlayerID | player_id | ||
| ) |
A U21 player joins the first-team squad (professional contract).
|
private |
| UpgradeQuote YouthAcademy::quote | ( | TeamID | team_id, |
| AcademyUpgrade | kind, | ||
| const GameDateValue & | date, | ||
| float | board_confidence, | ||
| bool | embargoed | ||
| ) | const |
Next step of an investment and the board's likely answer today.
| AcademyRatings YouthAcademy::ratings | ( | TeamID | team_id | ) | const |
| const YouthRecord * YouthAcademy::record | ( | PlayerID | player_id | ) | const |
|
private |
| YouthActionResult YouthAcademy::releaseCandidate | ( | TeamID | team_id, |
| PlayerID | player_id | ||
| ) |
The trialist leaves football's professional ranks (removed).
|
private |
| UpgradeRequestResult YouthAcademy::requestUpgrade | ( | const GameDateValue & | date, |
| TeamID | team_id, | ||
| AcademyUpgrade | kind, | ||
| float | board_confidence, | ||
| bool | embargoed, | ||
| Inbox & | inbox | ||
| ) |
| ReserveQuota YouthAcademy::reserveQuota | ( | TeamID | team_id | ) | const |
Size and over-age places of a club's U21 squad.
|
inline |
Managed club's U21 results this season, oldest first.
| std::vector< YouthTableRow > YouthAcademy::reserveTable | ( | TeamID | team_id | ) | const |
U21 league of team_id's country (every division), leader first.
| YouthActionResult YouthAcademy::reserveToU18 | ( | TeamID | team_id, |
| PlayerID | player_id | ||
| ) |
A U21 player young enough for the U18s goes back to them.
|
inline |
Managed club's U18 results this season, oldest first.
|
private |
| void YouthAcademy::save | ( | const std::shared_ptr< DatabaseConnection > & | db_conn | ) | const |
|
inline |
Players on loan stay in their senior squads (never sent to the U21s).
|
private |
Computer-managed clubs without a U21 squad yet (new worlds and older saves) move young players outside their senior plans down.
| YouthActionResult YouthAcademy::signCandidate | ( | TeamID | team_id, |
| PlayerID | player_id | ||
| ) |
|
private |
|
private |
Sets Player::isAcademyPlayer() from the records (after loading).
| std::vector< YouthTableRow > YouthAcademy::table | ( | LeagueID | league_id | ) | const |
U18 league of league_id, leader first.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |