|
Player12
An open source football management simulator
|
#include <match_shirt_numbers.h>
Public Member Functions | |
| MatchShirtNumbers () | |
| void | reset () |
| void | reset (const MatchRenderSnapshot &snapshot) |
| int | numberFor (const MatchRenderPlayer &player, const std::vector< PlayerMatchStats > *) |
Static Private Member Functions | |
| static int | spareNumber (const std::bitset< NUMBERS > &worn, bool goalkeeper) |
Private Attributes | |
| std::bitset< NUMBERS > | home |
| std::bitset< NUMBERS > | away |
| std::vector< std::pair< const Player *, int > > | owners |
Static Private Attributes | |
| static constexpr int | NUMBERS = 100 |
| static constexpr int | FIRST_SPARE = 50 |
Shirt numbers of one match, handed out the same way by the 2D and 3D views: players wear their squad number. A player without one (an academy player called up) gets a free number: a goalkeeper one of the usual back-up keeper numbers, anyone else a spare number from 50 up, which squad numbers rarely reach. The squad numbers of the players in the match are reserved up front, so a call-up never takes a teammate's.
|
inline |
|
inline |
The player's number, assigned on first request; 0 without a player. stats is unused since players have squad numbers; it stays for the views that pass the engine's statistics.
|
inline |
Forgets every number (a new fixture).
|
inline |
A new fixture: forgets every number, then reserves the squad numbers of the players in snapshot.
|
inlinestaticprivate |
|
private |
|
staticconstexprprivate |
|
private |
|
staticconstexprprivate |
|
private |