Player12
An open source football management simulator
Loading...
Searching...
No Matches
Awards Namespace Reference

Selection rules of the league honours. More...

Functions

float playerScore (const AwardPlayerTally &tally, bool goalkeeper)
 
std::optional< std::size_t > bestPlayer (std::span< const AwardCandidate > candidates, std::uint16_t min_minutes, int max_age)
 
std::optional< std::size_t > goldenBoot (std::span< const AwardCandidate > candidates)
 
std::optional< std::size_t > goldenGlove (std::span< const AwardCandidate > candidates, std::uint16_t min_minutes)
 
std::array< std::optional< std::size_t >, TEAM_OF_SEASON_SIZE > teamOfSeason (std::span< const AwardCandidate > candidates, std::uint16_t min_minutes)
 
const char * slotKey (std::uint8_t slot)
 
std::optional< std::size_t > bestManager (std::span< const AwardClubTally > clubs, std::uint16_t min_matches)
 
std::uint16_t seasonMinMinutes (std::span< const AwardCandidate > candidates)
 
float goalScore (std::uint8_t minute, int own_before, int other_before, bool decisive, int reputation_gap, bool assisted)
 
float valueMultiplier (std::span< const AwardRecord > honours, const GameDateValue &today)
 

Variables

constexpr std::uint16_t MONTH_MIN_MINUTES = 270
 
constexpr float SEASON_MIN_SHARE = 0.5f
 
constexpr int YOUNG_MAX_AGE = 21
 
constexpr std::uint16_t MONTH_MIN_MATCHES = 3
 
constexpr std::uint16_t SEASON_MIN_MATCHES = 10
 
constexpr std::uint8_t CLEAN_SHEET_MINUTES = 60
 
constexpr std::size_t TEAM_OF_SEASON_SIZE = 11
 
constexpr float MAX_VALUE_PREMIUM = 0.25f
 

Detailed Description

Selection rules of the league honours.

Player awards rank by average match rating plus a small bonus for goals, assists and (goalkeepers) clean sheets per appearance, among players with enough minutes; ties go to the lower player id so the result never depends on iteration order. Manager awards compare league points with the points expected from both line-ups (BoardModel::expectedPoints).

Function Documentation

◆ bestManager()

std::optional< std::size_t > Awards::bestManager ( std::span< const AwardClubTally >  clubs,
std::uint16_t  min_matches 
)

Largest points-over-expectation with enough matches; ties: points, lower team id.

◆ bestPlayer()

std::optional< std::size_t > Awards::bestPlayer ( std::span< const AwardCandidate >  candidates,
std::uint16_t  min_minutes,
int  max_age = 0 
)

Best candidate with enough minutes and at most max_age (0 = any).

◆ goalScore()

float Awards::goalScore ( std::uint8_t  minute,
int  own_before,
int  other_before,
bool  decisive,
int  reputation_gap,
bool  assisted 
)

Importance of a goal for the Goal of the Month panel (no shot data is stored): late goals, winners and equalisers, goals against stronger opponents and goals without an assist score higher.

Parameters
own_before,other_beforeScore of the scorer's side before it.
decisiveThe game-winning goal (the winner's goal after which the opponent never drew level again).
reputation_gapOpponent reputation minus the scorer's club's.

◆ goldenBoot()

std::optional< std::size_t > Awards::goldenBoot ( std::span< const AwardCandidate >  candidates)

Most goals; ties: fewer minutes, more assists, lower id.

◆ goldenGlove()

std::optional< std::size_t > Awards::goldenGlove ( std::span< const AwardCandidate >  candidates,
std::uint16_t  min_minutes 
)

Goalkeeper with most clean sheets and enough minutes; ties: fewer minutes per clean sheet, lower id.

◆ playerScore()

float Awards::playerScore ( const AwardPlayerTally &  tally,
bool  goalkeeper 
)

Rating plus contribution bonus of a tally.

◆ seasonMinMinutes()

std::uint16_t Awards::seasonMinMinutes ( std::span< const AwardCandidate >  candidates)

Minimum minutes for season awards among candidates.

◆ slotKey()

const char * Awards::slotKey ( std::uint8_t  slot)

Language key of a Team of the Season slot (e.g. "AWARD_SLOT_GK").

◆ teamOfSeason()

std::array< std::optional< std::size_t >, TEAM_OF_SEASON_SIZE > Awards::teamOfSeason ( std::span< const AwardCandidate >  candidates,
std::uint16_t  min_minutes 
)

Best XI in a 4-3-3: GK, RB, CB, CB, LB, three midfielders, RW, ST, LW. Slots are filled from natural positions first, then from neighbouring ones; a slot stays empty when nobody qualifies.

◆ valueMultiplier()

float Awards::valueMultiplier ( std::span< const AwardRecord >  honours,
const GameDateValue &  today 
)

Market value multiplier from recent honours: +3% per monthly player award of the last 12 months (at most three), +8% per individual season award and +4% for the Team of the Season of the current or previous season, capped at +25%.

Variable Documentation

◆ CLEAN_SHEET_MINUTES

constexpr std::uint8_t Awards::CLEAN_SHEET_MINUTES = 60
inlineconstexpr

A clean sheet needs this many minutes from the start without conceding.

◆ MAX_VALUE_PREMIUM

constexpr float Awards::MAX_VALUE_PREMIUM = 0.25f
inlineconstexpr

Market value premium caps (see valueMultiplier).

◆ MONTH_MIN_MATCHES

constexpr std::uint16_t Awards::MONTH_MIN_MATCHES = 3
inlineconstexpr

◆ MONTH_MIN_MINUTES

constexpr std::uint16_t Awards::MONTH_MIN_MINUTES = 270
inlineconstexpr

Three full matches in the month.

◆ SEASON_MIN_MATCHES

constexpr std::uint16_t Awards::SEASON_MIN_MATCHES = 10
inlineconstexpr

◆ SEASON_MIN_SHARE

constexpr float Awards::SEASON_MIN_SHARE = 0.5f
inlineconstexpr

Share of the league's most-used player's minutes for season awards.

◆ TEAM_OF_SEASON_SIZE

constexpr std::size_t Awards::TEAM_OF_SEASON_SIZE = 11
inlineconstexpr

◆ YOUNG_MAX_AGE

constexpr int Awards::YOUNG_MAX_AGE = 21
inlineconstexpr