|
Player12
An open source football management simulator
|
National teams: confederations, competitions and pure helpers. More...
Classes | |
| struct | Fixture |
| struct | Group |
| struct | GroupRow |
| struct | Record |
Enumerations | |
| enum class | Confederation : uint8_t { Europe , Americas , Asia } |
| enum class | Competition : uint8_t { Friendly = 0 , WorldQualifier , ContinentalQualifier , NationsLeague , NationsLeagueFinals , WorldFinals , ContinentalFinals } |
| enum class | Stage : uint8_t { Group = 0 , QuarterFinal , SemiFinal , Final } |
| enum class | CallUpResult : uint8_t { Ok = 0 , NoSquad , Locked , TooMany , TooFew , NeedGoalkeepers , Ineligible , Duplicate } |
| Why a squad chosen by a head coach was refused. More... | |
Functions | |
| const char * | confederationKey (Confederation confederation) |
| Confederation | confederationOf (Language nation) |
| std::string | teamNameKey (Language nation) |
| const char * | competitionKey (Competition competition) |
| bool | isFinals (Competition competition) |
| const char * | stageKey (Stage stage) |
| std::optional< Language > | winnerOf (const Fixture &fixture) |
| std::vector< GroupRow > | groupTable (const Group &group, const std::vector< Fixture > &fixtures, const std::map< Language, double > &rating) |
| bool | canSwitchNation (const Record &record, const GameDateValue &today) |
| std::vector< std::vector< std::pair< size_t, size_t > > > | roundRobin (size_t teams, bool double_round) |
| size_t | finalsSize (size_t pool) |
| const char * | callUpResultKey (CallUpResult result) |
| double | selectionScore (const Player &player, uint16_t caps, const StatsConfig &config) |
| std::vector< PlayerID > | selectSquad (const std::vector< const Player * > &eligible, size_t size, const StatsConfig &config, const std::unordered_map< PlayerID, uint16_t > &caps) |
Picks a squad of size: three goalkeepers and a balanced mix of defenders, midfielders and forwards, ranked by ability, form, condition and experience (caps); shortfalls are filled by the best remaining players. Deterministic (ties by player ID). | |
Variables | |
| constexpr size_t | WINDOW_SQUAD = 24 |
| constexpr size_t | FINALS_SQUAD = 26 |
| constexpr size_t | MIN_CALL_UPS = 18 |
| constexpr size_t | MIN_CALL_UP_GOALKEEPERS = 2 |
| constexpr int | MIN_SQUAD_AGE = 17 |
National teams: confederations, competitions and pure helpers.
One national team per nationality with enough players. The two-season cycle follows the real calendar: in the season before a summer finals tournament the September-March windows host the qualifiers; in the other season the autumn windows host a nations league (its best group winners meet in June) and March has friendlies. Finals alternate between a world tournament and continental tournaments every two years. Idle nations play friendlies.
|
strong |
|
strong |
|
strong |
|
strong |
| const char * International::callUpResultKey | ( | CallUpResult | result | ) |
Language key of a call-up verdict.
| bool International::canSwitchNation | ( | const Record & | record, |
| const GameDateValue & | today | ||
| ) |
Switching nation (design default, after the 2020 eligibility rules): at most three senior caps, all before 21, none at a finals tournament, and three years since the last one.
| const char * International::competitionKey | ( | Competition | competition | ) |
Language key naming a competition.
| const char * International::confederationKey | ( | Confederation | confederation | ) |
Language key naming a confederation.
| Confederation International::confederationOf | ( | Language | nation | ) |
| size_t International::finalsSize | ( | size_t | pool | ) |
Finals size for a pool of nations: 16, 8, 4, or 0 (too few).
| std::vector< International::GroupRow > International::groupTable | ( | const Group & | group, |
| const std::vector< Fixture > & | fixtures, | ||
| const std::map< Language, double > & | rating | ||
| ) |
Group table: points, goal difference, goals scored, then rating.
| bool International::isFinals | ( | Competition | competition | ) |
| std::vector< std::vector< std::pair< size_t, size_t > > > International::roundRobin | ( | size_t | teams, |
| bool | double_round | ||
| ) |
Rounds of a round robin (circle method); pairs are team indices.
| double International::selectionScore | ( | const Player & | player, |
| uint16_t | caps, | ||
| const StatsConfig & | config | ||
| ) |
Selection score of a player: ability, form, condition and caps.
| std::vector< PlayerID > International::selectSquad | ( | const std::vector< const Player * > & | eligible, |
| size_t | size, | ||
| const StatsConfig & | config, | ||
| const std::unordered_map< PlayerID, uint16_t > & | caps | ||
| ) |
Picks a squad of size: three goalkeepers and a balanced mix of defenders, midfielders and forwards, ranked by ability, form, condition and experience (caps); shortfalls are filled by the best remaining players. Deterministic (ties by player ID).
| const char * International::stageKey | ( | Stage | stage | ) |
| std::string International::teamNameKey | ( | Language | nation | ) |
Language key of a national team's name (e.g. "NT_Italian").
Winner of a played fixture (penalties included); nullopt for draws.
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
A head coach calls up at least this many players, two goalkeepers.
|
inlineconstexpr |
Youngest age for a senior call-up.
|
inlineconstexpr |
Squad sizes: 24 for a window, 26 for a finals tournament.