|
Player12
An open source football management simulator
|
Structured summary of a played fixture, persisted per fixture. More...
#include <match_report.h>
Public Member Functions | |
| void | fillFromEngine (const MatchEngine &engine, TeamID home_id, TeamID away_id) |
| void | addLineupAppearances (const Lineup &lineup, TeamID team_id) |
| void | creditExtraTimeGoals (const Lineup &lineup, TeamID team_id, bool home, uint8_t goals, uint32_t seed) |
| std::string | eventsToJson () const |
| std::string | playersToJson () const |
| std::string | statsToJson () const |
| void | eventsFromJson (const std::string &json) |
| void | playersFromJson (const std::string &json) |
| void | statsFromJson (const std::string &json) |
Public Attributes | |
| GameDateValue | date |
| TeamID | home_team_id = 0 |
| TeamID | away_team_id = 0 |
| MatchType | match_type = MatchType::LEAGUE |
| LeagueID | competition_id = 0 |
| uint8_t | stage = 0 |
| uint16_t | season = 0 |
| uint8_t | home_goals = 0 |
| uint8_t | away_goals = 0 |
| bool | extra_time = false |
| bool | penalties = false |
| uint8_t | home_penalties = 0 |
| uint8_t | away_penalties = 0 |
| uint32_t | attendance = 0 |
| TeamMatchStats | home_stats |
| TeamMatchStats | away_stats |
| std::vector< MatchReportEvent > | events |
| std::vector< PlayerMatchLine > | players |
| std::optional< bool > | played_home |
| float | played_share = 0.0f |
Structured summary of a played fixture, persisted per fixture.
Fixtures are identified by (date, home team, away team). Scores include extra-time goals; penalties are reported separately.
Records the starters of a lineup as having played the full match (used when no per-player engine data exists, e.g. score-only results).
| void MatchReport::creditExtraTimeGoals | ( | const Lineup & | lineup, |
| TeamID | team_id, | ||
| bool | home, | ||
| uint8_t | goals, | ||
| uint32_t | seed | ||
| ) |
Credits goals extra-time goals of one side when extra time was resolved statistically (Competitions::resolveDrawnKnockout, the fallback for a tie recorded level without the engine playing it): each goal is given to a player of lineup who finished the match, drawn from seed with forwards and good finishers favoured: it counts on his line and becomes a GOAL event between minutes 91 and 120. When the side has nobody left to credit, the event has no player (a team goal).
| void MatchReport::eventsFromJson | ( | const std::string & | json | ) |
| std::string MatchReport::eventsToJson | ( | ) | const |
| void MatchReport::fillFromEngine | ( | const MatchEngine & | engine, |
| TeamID | home_id, | ||
| TeamID | away_id | ||
| ) |
Copies the engine's final score, team totals, per-player lines and the scorer/card events.
| void MatchReport::playersFromJson | ( | const std::string & | json | ) |
| std::string MatchReport::playersToJson | ( | ) | const |
| void MatchReport::statsFromJson | ( | const std::string & | json | ) |
| std::string MatchReport::statsToJson | ( | ) | const |
| uint32_t MatchReport::attendance = 0 |
0 until stadiums/attendance are modelled.
| uint8_t MatchReport::away_goals = 0 |
| uint8_t MatchReport::away_penalties = 0 |
| TeamMatchStats MatchReport::away_stats |
| TeamID MatchReport::away_team_id = 0 |
| LeagueID MatchReport::competition_id = 0 |
| GameDateValue MatchReport::date |
| std::vector<MatchReportEvent> MatchReport::events |
| bool MatchReport::extra_time = false |
| uint8_t MatchReport::home_goals = 0 |
| uint8_t MatchReport::home_penalties = 0 |
| TeamMatchStats MatchReport::home_stats |
| TeamID MatchReport::home_team_id = 0 |
| MatchType MatchReport::match_type = MatchType::LEAGUE |
| bool MatchReport::penalties = false |
| std::optional<bool> MatchReport::played_home |
Play mode: the side the manager played himself on the pitch (empty when the match was watched or simulated) and his share of that side's passes, shots and tackles in [0, 1]. Stored with the team statistics.
| float MatchReport::played_share = 0.0f |
| std::vector<PlayerMatchLine> MatchReport::players |
| uint16_t MatchReport::season = 0 |
| uint8_t MatchReport::stage = 0 |