Player12
An open source football management simulator
Loading...
Searching...
No Matches
MatchEvent Struct Reference

#include <match_events.h>

Public Attributes

float timeMinute = 0.0f
 
std::string description
 
MatchEventType type = MatchEventType::INFO
 
int period = 1
 
float addedMinute = 0.0f
 
bool hasTeam = false
 
bool isHomeTeam = false
 
PlayerID primaryPlayerId = 0
 
PlayerID secondaryPlayerId = 0
 
Vector2F position {MatchTuning::Pitch::CENTRE, MatchTuning::Pitch::CENTRE}
 
float xg = 0.0f
 
MatchEventDetail detail = MatchEventDetail::NONE
 
int homeScore = 0
 
int awayScore = 0
 
int minutes = 0
 
int homeShootout = 0
 
int awayShootout = 0
 

Detailed Description

One entry of the match log. The structured fields say what happened; description is the localised commentary line (MatchCommentary) written when the event is logged, so views that know the team names or switch language should call MatchCommentary::describe() instead.

timeMinute is the match clock: the first half runs from 0 to 45 plus its added time, the second half restarts at 45. addedMinute is the part of the clock beyond the regulation end of the period (0 when not in added time), so "45+2'" is timeMinute 47 in period 1 with addedMinute 2. hasTeam/isHomeTeam describe the side of the primary player (for an OWN_GOAL that is the defender's side; the goal counts for the other side). For goals the secondary player is the assist provider, for fouls the fouled player, for substitutions the outgoing player and for saves the shooter.

Member Data Documentation

◆ addedMinute

float MatchEvent::addedMinute = 0.0f

◆ awayScore

int MatchEvent::awayScore = 0

◆ awayShootout

int MatchEvent::awayShootout = 0

◆ description

std::string MatchEvent::description

◆ detail

◆ hasTeam

bool MatchEvent::hasTeam = false

◆ homeScore

int MatchEvent::homeScore = 0

Score once the event happened (after the goal for a goal).

◆ homeShootout

int MatchEvent::homeShootout = 0

Penalty shootout score once the event happened (0-0 before one).

◆ isHomeTeam

bool MatchEvent::isHomeTeam = false

◆ minutes

int MatchEvent::minutes = 0

ADDED_TIME: the announced added minutes.

◆ period

int MatchEvent::period = 1

◆ position

◆ primaryPlayerId

PlayerID MatchEvent::primaryPlayerId = 0

◆ secondaryPlayerId

PlayerID MatchEvent::secondaryPlayerId = 0

◆ timeMinute

float MatchEvent::timeMinute = 0.0f

◆ type

◆ xg

float MatchEvent::xg = 0.0f

The documentation for this struct was generated from the following file: