|
Player12
An open source football management simulator
|
Classes | |
| struct | FoulContext |
| struct | Knockout |
| struct | StoppageLog |
| struct | TackleContext |
Enumerations | |
| enum class | FoulSanction : std::uint8_t { NONE , YELLOW , SECOND_YELLOW , RED } |
Functions | |
| int | computeAddedMinutes (const StoppageLog &log, int period) |
| float | periodStartMinute (int period) |
| float | periodEndMinute (int period) |
| bool | shootoutDecided (int homeGoals, int homeKicks, int awayGoals, int awayKicks) |
| float | computeMatchRating (const PlayerMatchStats &stats, bool goalkeeper, bool defender, int teamGoalDifference) |
| float | playerHeightMetres (std::uint8_t heightCentimetres) |
| float | headerReachMetres (float heightMetres, float physicality) |
| float | goalkeeperReachMetres (float heightMetres, float goalkeeping) |
| float | goalkeeperHandlingRadiusMetres (float heightMetres, float goalkeeping, float ballHeightMetres, bool diving) |
| float | aerialDuelStrength (float heightMetres, float physicality, float ballHeightMetres) |
| FoulSanction | decideFoulSanction (const FoulContext &context) |
| float | tackleWinChance (const TackleContext &context) |
| float | tackleFoulPropensity (const TackleContext &context) |
| float | staminaDrainPerSecond (float speedRatio, float endurance, float pressingIntensity) |
Pure, deterministic rules used by the match engine. Everything here is a function of its arguments (random rolls are passed in), so each rule can be unit tested without running a match.
|
strong |
| float MatchRules::aerialDuelStrength | ( | float | heightMetres, |
| float | physicality, | ||
| float | ballHeightMetres | ||
| ) |
Relative strength of a player in an aerial duel for a ball at a height.
| int MatchRules::computeAddedMinutes | ( | const StoppageLog & | log, |
| int | period | ||
| ) |
Whole added minutes for a period (1-2, or 3-4 in extra time) from its stoppages.
| float MatchRules::computeMatchRating | ( | const PlayerMatchStats & | stats, |
| bool | goalkeeper, | ||
| bool | defender, | ||
| int | teamGoalDifference | ||
| ) |
Event-driven match rating: 6.0 baseline, bounded to [3, 10]. teamGoalDifference is the player's team score minus the opponent's.
| FoulSanction MatchRules::decideFoulSanction | ( | const FoulContext & | context | ) |
| float MatchRules::goalkeeperHandlingRadiusMetres | ( | float | heightMetres, |
| float | goalkeeping, | ||
| float | ballHeightMetres, | ||
| bool | diving = false |
||
| ) |
Horizontal hand reach from the current body position at a ball height.
| float MatchRules::goalkeeperReachMetres | ( | float | heightMetres, |
| float | goalkeeping | ||
| ) |
Highest ball height (metres) a goalkeeper can claim with the hands.
| float MatchRules::headerReachMetres | ( | float | heightMetres, |
| float | physicality | ||
| ) |
Highest ball height (metres) an outfield player can head.
| float MatchRules::periodEndMinute | ( | int | period | ) |
Clock minute at which a period's regulation time ends (45, 90, 105, 120).
| float MatchRules::periodStartMinute | ( | int | period | ) |
Clock minute at which a period starts (0, 45, 90, 105).
| float MatchRules::playerHeightMetres | ( | std::uint8_t | heightCentimetres | ) |
Player height in metres; unknown (0) heights fall back to the default.
| bool MatchRules::shootoutDecided | ( | int | homeGoals, |
| int | homeKicks, | ||
| int | awayGoals, | ||
| int | awayKicks | ||
| ) |
Whether a penalty shootout is decided: one side can no longer be caught within the first MatchTuning::Timing::SHOOTOUT_KICKS kicks each, or, in sudden death, the sides have taken as many kicks and one has scored more.
|
inline |
Match condition drained per second for a player moving at speedRatio of their fresh top speed. endurance is the Stamina attribute in [0, 1].
| float MatchRules::tackleFoulPropensity | ( | const TackleContext & | context | ) |
Propensity for the challenge to be a foul: applied in full to a missed challenge and scaled down for one that also reached the ball.
| float MatchRules::tackleWinChance | ( | const TackleContext & | context | ) |
Chance that a challenge reaches the ball first.