Player12
An open source football management simulator
Loading...
Searching...
No Matches
MatchCommentary Namespace Reference

Functions

const char * key (const MatchEvent &event)
 
std::string fill (std::string_view pattern, const MatchEvent &event, const MatchCommentaryNames &names)
 
std::string describe (const MatchEvent &event, const MatchCommentaryNames &names)
 

Detailed Description

Localised one-line commentary for structured match events. The engine only records what happened (type, side, players, score, detail); every word shown to the user comes from the MATCH_COMMENT_* language keys, so the presentation layer can re-describe events in the current language with the real team names.

Function Documentation

◆ describe()

std::string MatchCommentary::describe ( const MatchEvent &  event,
const MatchCommentaryNames &  names 
)

The localised line for event: fill() of its key's translation.

◆ fill()

std::string MatchCommentary::fill ( std::string_view  pattern,
const MatchEvent &  event,
const MatchCommentaryNames &  names 
)

Fills {team}, {player}, {other}, {home}, {away}, {homeScore}, {awayScore}, {minutes}, {homePens} and {awayPens} of pattern from event and names.

◆ key()

const char * MatchCommentary::key ( const MatchEvent &  event)

Language key of the line for event (e.g. "MATCH_COMMENT_CORNER").