Player12
An open source football management simulator
Loading...
Searching...
No Matches
youth_academy.h File Reference
#include <array>
#include <cstdint>
#include <functional>
#include <memory>
#include <optional>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
#include "global/languages.h"
#include "global/types.h"
#include "model/gamedate.h"
#include "model/player.h"
#include "model/staff.h"

Go to the source code of this file.

Classes

struct  YouthProgressPoint
 Monthly snapshot of an academy player's ability. More...
 
struct  YouthRecord
 Academy registration of one player. More...
 
struct  YouthTableRow
 A club's row in its U18 league. More...
 
struct  YouthResult
 A U18 or U21 match of the managed club, from its point of view. More...
 
struct  ReserveQuota
 Over-age places used in a club's U21 squad. More...
 
struct  AcademyClub
 Academy state of one club. More...
 
struct  IntakeInputs
 Everything that shapes an intake. Qualities are 0-1. More...
 
struct  CandidateProfile
 Hidden profile of one intake candidate. More...
 
struct  IntakeClass
 One club's intake of one year. More...
 
struct  IntakePreview
 What the head of youth development says before intake day. More...
 
struct  HeadOfYouth
 The club's head of youth development (id 0: vacant). More...
 
struct  AcademyRatings
 Academy ratings shown on the overview (1-100). More...
 
struct  YouthEstimate
 Scouted ranges of an academy player (never exact values). More...
 
struct  UpgradeQuote
 Price and schedule of the next step of an academy investment. More...
 
class  YouthAcademy
 Academies of every club: yearly intake cycle, U18 and U21 squads and their leagues, youth contracts and board-funded academy projects. More...
 
struct  YouthAcademy::YouthRound
 
struct  YouthAcademy::YouthMatchSheet
 

Namespaces

namespace  YouthModel
 Pure academy rules (tested without a world).
 

Enumerations

enum class  YouthStatus : std::uint8_t { Candidate = 0 , Squad , Graduated , Reserve }
 Where an academy player stands (values are persisted). More...
 
enum class  YouthContract : std::uint8_t { None = 0 , Scholarship , Professional }
 Contract of an academy player (values are persisted). More...
 
enum class  IntakeQuality : std::uint8_t { Weak = 0 , Average , Promising , Golden }
 Head of youth development's verdict on an intake. More...
 
enum class  AcademyUpgrade : std::uint8_t { None = 0 , Facilities , Recruitment }
 Academy investments the board can approve (values are persisted). More...
 
enum class  YouthActionResult : std::uint8_t {
  Ok , NoClub , UnknownPlayer , NotAllowed ,
  TooYoung , TooOld , OverageFull
}
 Outcome of an action on an academy player. More...
 
enum class  UpgradeRequestResult : std::uint8_t {
  Approved , NoClub , InProgress , TooSoon ,
  AtMaximum , BeyondStature , CannotAfford , NoConfidence
}
 Board answer to an academy investment request. More...
 

Functions

IntakeClass YouthModel::planIntake (const IntakeInputs &inputs, std::uint64_t world_seed, std::uint16_t year, TeamID team_id)
 
IntakePreview YouthModel::summarize (const IntakeClass &intake)
 
float YouthModel::regionTalent (Language country)
 
int YouthModel::firstProfessionalAge (Language country)
 
float YouthModel::academyGrade (const IntakeInputs &inputs)
 
std::size_t YouthModel::u18SquadLimit (float grade)
 
int YouthModel::computerSignings (float grade, std::size_t candidates)
 
std::uint32_t YouthModel::scholarshipWage (LeagueID league_id)
 
std::uint8_t YouthModel::youthContractYears (int age)
 
bool YouthModel::isHomegrown (int joined_age, int age)
 
YouthActionResult YouthModel::reserveEligibility (int age, PlayerRole role, const ReserveQuota &quota)
 
float YouthModel::staffProfessionalism (std::uint64_t world_seed, StaffID staff_id)
 
const char * YouthModel::staffStyleKey (float professionalism)
 
const char * YouthModel::personalityKey (const PlayerTraits &traits)
 
const char * YouthModel::qualityKey (IntakeQuality quality)
 
const char * YouthModel::contractKey (YouthContract contract)
 
const char * YouthModel::requestResultKey (UpgradeRequestResult result)
 
const char * YouthModel::actionResultKey (YouthActionResult result)
 
std::pair< int, int > YouthModel::simulateMatch (float home_strength, float away_strength, WorldRng &rng)
 
std::int64_t YouthModel::upgradeCost (AcademyUpgrade kind, int target, LeagueID league_id)
 
int YouthModel::upgradeDays (AcademyUpgrade kind, int target)
 
std::uint8_t YouthModel::upgradeTarget (AcademyUpgrade kind, int current)
 

Variables

constexpr std::uint8_t YouthModel::PREVIEW_MONTH = 2
 
constexpr std::uint8_t YouthModel::PREVIEW_DAY = 1
 
constexpr std::uint8_t YouthModel::INTAKE_MONTH = 3
 
constexpr std::uint8_t YouthModel::INTAKE_DAY = 15
 
constexpr int YouthModel::DECISION_DAYS = 30
 
constexpr int YouthModel::U18_MAX_AGE = 18
 
constexpr int YouthModel::U21_MAX_AGE = 21
 
constexpr std::size_t YouthModel::U21_OVERAGE_OUTFIELD = 3
 
constexpr std::size_t YouthModel::U21_OVERAGE_GOALKEEPERS = 1
 
constexpr std::size_t YouthModel::U21_SQUAD_LIMIT = 16
 
constexpr int YouthModel::HOMEGROWN_SEASONS = 3
 
constexpr int YouthModel::MINOR_CONTRACT_YEARS = 3
 
constexpr int YouthModel::SIGN_MIN = 2
 
constexpr int YouthModel::SIGN_MAX = 12
 
constexpr int YouthModel::PRO_POLICY_AGE = 17
 

Enumeration Type Documentation

◆ AcademyUpgrade

enum class AcademyUpgrade : std::uint8_t
strong

Academy investments the board can approve (values are persisted).

Enumerator
None 
Facilities 
Recruitment 

◆ IntakeQuality

enum class IntakeQuality : std::uint8_t
strong

Head of youth development's verdict on an intake.

Enumerator
Weak 
Average 
Promising 
Golden 

◆ UpgradeRequestResult

enum class UpgradeRequestResult : std::uint8_t
strong

Board answer to an academy investment request.

Enumerator
Approved 
NoClub 
InProgress 

A project is already being built.

TooSoon 

The board answered a request recently.

AtMaximum 

Nothing left to improve.

BeyondStature 

Too ambitious for the club's reputation.

CannotAfford 

Cash (after a payroll reserve) does not cover it.

NoConfidence 

The board does not trust the manager enough.

◆ YouthActionResult

enum class YouthActionResult : std::uint8_t
strong

Outcome of an action on an academy player.

Enumerator
Ok 
NoClub 
UnknownPlayer 
NotAllowed 

Wrong status or club for this action.

TooYoung 

Below the first professional contract age.

TooOld 

Beyond the age limit of the squad.

OverageFull 

The U21 over-age places are taken.

◆ YouthContract

enum class YouthContract : std::uint8_t
strong

Contract of an academy player (values are persisted).

Enumerator
None 

Trialist: nothing signed yet.

Scholarship 

Scholarship with a fixed stipend.

Professional 

First professional contract.

◆ YouthStatus

enum class YouthStatus : std::uint8_t
strong

Where an academy player stands (values are persisted).

Enumerator
Candidate 

Intake trialist waiting for a contract offer.

Squad 

Member of the U18 squad.

Graduated 

Promoted academy product (kept until 21).

Reserve 

Member of the U21 (reserve) squad.