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

Read-only view models for league tables and fixture lists. More...

Classes

struct  FixtureRow
 One scheduled or played match. More...
 
struct  StandingRow
 One row of a league table. More...
 
struct  Zones
 Number of promotion and relegation places in a league table. More...
 

Functions

std::vector< StandingRow > buildStandings (const GameController &controller, LeagueID leagueId)
 League table for one league in the competitions model's order (points, goal difference, goals scored, head-to-head, name).
 
Zones zonesFor (const GameController &controller, LeagueID leagueId)
 Promotion (top) and relegation (bottom) places of a league.
 
std::vector< FixtureRow > buildLeagueFixtures (const GameController &controller, LeagueID leagueId)
 All league fixtures of a league in date order, with rounds.
 
std::vector< FixtureRow > buildClubFixtures (const GameController &controller, TeamID teamId)
 Every fixture (all competitions) of one club in date order.
 
std::optional< FixtureRow > nextFixture (const GameController &controller, TeamID teamId)
 The club's next unplayed fixture on or after the current date.
 
const char * matchTypeKey (MatchType type)
 Localisation key naming a competition type.
 
UI::Outcome outcomeFor (const FixtureRow &fixture, TeamID teamId)
 Outcome of a played fixture from one club's perspective.
 

Variables

constexpr size_t FORM_LENGTH = 5
 

Detailed Description

Read-only view models for league tables and fixture lists.

Built from the competitions model and the in-memory calendar (no SQL) and cached by the screens until the game state changes.

Function Documentation

◆ buildClubFixtures()

std::vector< FixtureRow > CompetitionView::buildClubFixtures ( const GameController &  controller,
TeamID  teamId 
)

Every fixture (all competitions) of one club in date order.

◆ buildLeagueFixtures()

std::vector< FixtureRow > CompetitionView::buildLeagueFixtures ( const GameController &  controller,
LeagueID  leagueId 
)

All league fixtures of a league in date order, with rounds.

◆ buildStandings()

std::vector< StandingRow > CompetitionView::buildStandings ( const GameController &  controller,
LeagueID  leagueId 
)

League table for one league in the competitions model's order (points, goal difference, goals scored, head-to-head, name).

◆ matchTypeKey()

const char * CompetitionView::matchTypeKey ( MatchType  type)

Localisation key naming a competition type.

◆ nextFixture()

std::optional< FixtureRow > CompetitionView::nextFixture ( const GameController &  controller,
TeamID  teamId 
)

The club's next unplayed fixture on or after the current date.

◆ outcomeFor()

UI::Outcome CompetitionView::outcomeFor ( const FixtureRow &  fixture,
TeamID  teamId 
)

Outcome of a played fixture from one club's perspective.

◆ zonesFor()

Zones CompetitionView::zonesFor ( const GameController &  controller,
LeagueID  leagueId 
)

Promotion (top) and relegation (bottom) places of a league.

Variable Documentation

◆ FORM_LENGTH

constexpr size_t CompetitionView::FORM_LENGTH = 5
constexpr