|
Player12
An open source football management simulator
|
Classes | |
| struct | Entry |
Enumerations | |
| enum class | Change : std::uint8_t { Changed , Swapped , Invalid } |
Functions | |
| constexpr bool | isValid (int number) |
| void | assign (std::span< Entry > squad) |
Variables | |
| constexpr int | MIN_NUMBER = 1 |
| constexpr int | MAX_NUMBER = 99 |
| constexpr int | YOUNG_AGE = 20 |
Persistent squad numbers (1-99, unique within a club's senior squad).
A new squad is numbered the traditional way: the first goalkeeper wears 1, the regulars 2-11 by position (2 right back, 3 left back, 4 and 5 centre backs, 6 holding midfielder, 7 right wing, 8 centre midfielder, 9 striker, 10 playmaker, 11 left wing), back-up goalkeepers 12, 13, 25 or 31, the other seniors 14 and up and the youngsters 30 and up. A newcomer keeps the number he wore before when it is free at his new club, otherwise he takes a free number of his position.
|
strong |
| void SquadNumbers::assign | ( | std::span< Entry > | squad | ) |
Gives every player of squad a valid number, unique within the squad. Valid numbers are kept (on a clash the better player keeps his); the others are handed out best player first. A squad without any number is numbered from scratch (1-11 for the regulars, see above); in a numbered squad newcomers take their preferred number if free, else a free traditional number of their position, else a free squad number. Deterministic: depends only on the entries, not on their order.
|
constexpr |
True for a number a player can wear (1-99).
|
inlineconstexpr |
|
inlineconstexpr |
|
inlineconstexpr |
Players up to this age without a regular place get a number from 30.