|
Player12
An open source football management simulator
|
Final league tables of past seasons and the managed club's season reviews (tables SeasonTables and SeasonReviews). More...
#include <season_review.h>
Public Member Functions | |
| void | recordTables (std::uint16_t season, std::uint16_t start_year, const std::map< LeagueID, std::vector< StandingRow > > &tables) |
| void | recordReview (SeasonReview review) |
| std::vector< std::uint16_t > | seasonsOf (LeagueID league_id) const |
| const std::vector< StandingRow > * | table (std::uint16_t season, LeagueID league_id) const |
| bool | hasSeason (std::uint16_t season) const |
| std::uint16_t | startYear (std::uint16_t season) const |
| std::optional< std::pair< LeagueID, std::uint16_t > > | placing (std::uint16_t season, TeamID team_id) const |
| const std::vector< SeasonReview > & | reviews () const |
| SeasonReview * | review (std::uint16_t season) |
| const SeasonReview * | review (std::uint16_t season) const |
| const SeasonReview * | unseenReview () const |
| void | markSeen (std::uint16_t season) |
| void | load (const DatabaseConnection &db) |
| void | save (const DatabaseConnection &db) const |
| void | onSaved () |
Private Types | |
| using | TableKey = std::pair< std::uint16_t, LeagueID > |
Private Attributes | |
| std::map< TableKey, std::vector< StandingRow > > | tables |
| std::map< std::uint16_t, std::uint16_t > | start_years |
| std::vector< SeasonReview > | season_reviews |
| std::set< std::uint16_t > | unsaved_seasons |
| bool | reviews_dirty = false |
Final league tables of past seasons and the managed club's season reviews (tables SeasonTables and SeasonReviews).
|
private |
| bool SeasonArchive::hasSeason | ( | std::uint16_t | season | ) | const |
Whether final tables of season are stored.
| void SeasonArchive::load | ( | const DatabaseConnection & | db | ) |
| void SeasonArchive::markSeen | ( | std::uint16_t | season | ) |
| void SeasonArchive::onSaved | ( | ) |
| std::optional< std::pair< LeagueID, std::uint16_t > > SeasonArchive::placing | ( | std::uint16_t | season, |
| TeamID | team_id | ||
| ) | const |
League and final position of team_id in season.
| void SeasonArchive::recordReview | ( | SeasonReview | review | ) |
| void SeasonArchive::recordTables | ( | std::uint16_t | season, |
| std::uint16_t | start_year, | ||
| const std::map< LeagueID, std::vector< StandingRow > > & | tables | ||
| ) |
Stores the final tables of season (before promotion/relegation).
| SeasonReview * SeasonArchive::review | ( | std::uint16_t | season | ) |
| const SeasonReview * SeasonArchive::review | ( | std::uint16_t | season | ) | const |
|
inline |
| void SeasonArchive::save | ( | const DatabaseConnection & | db | ) | const |
Writes new tables and every review (inside the caller's transaction).
| std::vector< std::uint16_t > SeasonArchive::seasonsOf | ( | LeagueID | league_id | ) | const |
Seasons with a stored final table of league_id, newest first.
| std::uint16_t SeasonArchive::startYear | ( | std::uint16_t | season | ) | const |
Calendar year season started in (0 if not stored).
| const std::vector< StandingRow > * SeasonArchive::table | ( | std::uint16_t | season, |
| LeagueID | league_id | ||
| ) | const |
Final table of league_id in season (nullptr if not stored).
| const SeasonReview * SeasonArchive::unseenReview | ( | ) | const |
The newest review not shown yet, if any.
|
private |
|
private |
|
private |
|
private |
|
private |