|
Player12
An open source football management simulator
|
#include <match_tracking.h>
Public Member Functions | |
| void | setEnabled (bool on) |
| bool | isEnabled () const |
| void | touch (std::size_t player, bool home, Vector2F position, float minute, int period) |
| void | passReleased (Vector2F origin, bool open_play) |
| void | passCompleted (std::size_t passer, std::size_t receiver, bool home, Vector2F reception) |
| void | shot (std::size_t creator, float xg, TrackedShot kind) |
| void | pressure (std::size_t player, double spell) |
| std::size_t | playerCount () const |
| const TrackedPlayer * | player (std::size_t index) const |
| std::uint16_t | passes (std::size_t from, std::size_t to) const |
| const std::vector< TrackedShot > & | shots () const |
| const std::array< std::array< std::uint16_t, MatchTracking::BUCKETS >, 2 > & | finalThirdTouches () const |
Private Member Functions | |
| TrackedPlayer * | slot (std::size_t index) |
Private Attributes | |
| bool | enabled = true |
| std::vector< TrackedPlayer > | players |
| std::vector< std::uint16_t > | pass_matrix |
| std::vector< TrackedShot > | shot_kinds |
| std::array< std::array< std::uint16_t, MatchTracking::BUCKETS >, 2 > | final_third {} |
| Vector2F | pass_origin {0.5f, 0.5f} |
| bool | pass_open_play = false |
Cheap per-match recorder fed by the match engine: touch maps, completed passes between team-mates, progressive passes, pressures, expected assists and final-third touches over time. Players are the engine's stats indices (MatchEngine::getPlayerStats()). Storage is allocated on the first recorded event, so a disabled recorder (background fixtures) costs nothing.
|
inline |
Final-third touches per bucket, index 0 home.
|
inline |
| void MatchTracker::passCompleted | ( | std::size_t | passer, |
| std::size_t | receiver, | ||
| bool | home, | ||
| Vector2F | reception | ||
| ) |
The last released pass reached a team-mate.
| std::uint16_t MatchTracker::passes | ( | std::size_t | from, |
| std::size_t | to | ||
| ) | const |
Completed passes from one stats index to another.
| void MatchTracker::passReleased | ( | Vector2F | origin, |
| bool | open_play | ||
| ) |
A pass leaves the passer's foot (origin in the engine frame).
| const TrackedPlayer * MatchTracker::player | ( | std::size_t | index | ) | const |
nullptr for players without any tracked action.
|
inline |
| void MatchTracker::pressure | ( | std::size_t | player, |
| double | spell | ||
| ) |
A pressing player close to the carrier during spell.
|
inline |
| void MatchTracker::shot | ( | std::size_t | creator, |
| float | xg, | ||
| TrackedShot | kind | ||
| ) |
A shot; creator is the stats index of the chance creator, or MatchTracking::MAX_PLAYERS when none.
|
inline |
|
private |
| void MatchTracker::touch | ( | std::size_t | player, |
| bool | home, | ||
| Vector2F | position, | ||
| float | minute, | ||
| int | period | ||
| ) |
A touch at a pitch position (engine frame: home attacks x = 1).
|
private |
|
private |
|
private |
Dense MAX_PLAYERS x MAX_PLAYERS matrix, allocated on the first pass.
|
private |
|
private |
|
private |
|
private |