|
Player12
An open source football management simulator
|
Monthly and season honours of every league. More...
#include <awards.h>
Public Member Functions | |
| void | onMatchPlayed (const GameData &gamedata, const MatchReport &report, float home_expected, float away_expected) |
| std::vector< AwardRecord > | onMonthStart (GameData &gamedata, const GameDateValue &date, TeamID managed_team_id, Inbox &inbox, BoardState &board) |
| std::vector< AwardRecord > | awardMonth (const GameData &gamedata, std::uint16_t season_year, std::uint8_t month) |
| std::vector< AwardRecord > | awardSeason (const GameData &gamedata, std::uint16_t season_year) |
| const std::vector< AwardRecord > & | history () const |
| std::vector< AwardRecord > | honoursFor (PlayerID player_id) const |
| std::vector< AwardRecord > | forLeague (LeagueID league_id, std::uint16_t season_year) const |
| int | seasonHonours (PlayerID player_id, TeamID team_id) const |
| float | valueMultiplier (PlayerID player_id, const GameDateValue &today) const |
| const std::map< std::pair< LeagueID, PlayerID >, AwardPlayerTally > & | seasonTallies () const |
| const std::map< std::pair< LeagueID, PlayerID >, AwardPlayerTally > & | monthTallies () const |
| void | clear () |
| void | load (const std::shared_ptr< DatabaseConnection > &db_conn) |
| void | save (const std::shared_ptr< DatabaseConnection > &db_conn) const |
Private Types | |
| using | PlayerTallies = std::map< std::pair< LeagueID, PlayerID >, AwardPlayerTally > |
| using | ClubTallies = std::map< TeamID, AwardClubTally > |
Private Member Functions | |
| std::vector< AwardCandidate > | candidates (const GameData &gamedata, const PlayerTallies &tallies, LeagueID league_id) const |
| void | addRecord (const GameData &gamedata, AwardRecord record, std::vector< AwardRecord > &given) |
Private Attributes | |
| std::vector< AwardRecord > | records |
| PlayerTallies | month_players |
| PlayerTallies | season_players |
| ClubTallies | month_clubs |
| ClubTallies | season_clubs |
| std::map< LeagueID, GoalCandidate > | month_goals |
Monthly and season honours of every league.
Tallies league matches as they are played and hands out the monthly awards on the first day of the next month and the season awards on 1 June, when every league has finished. The history is kept for the whole career. Winners gain morale; the managed club's manager awards please the board; the Manager of the Season's club gains a reputation point.
|
private |
|
private |
|
private |
| std::vector< AwardRecord > AwardSystem::awardMonth | ( | const GameData & | gamedata, |
| std::uint16_t | season_year, | ||
| std::uint8_t | month | ||
| ) |
Monthly awards of the tallies collected so far (clears them).
| std::vector< AwardRecord > AwardSystem::awardSeason | ( | const GameData & | gamedata, |
| std::uint16_t | season_year | ||
| ) |
Season awards of the tallies collected so far (clears them).
|
private |
| void AwardSystem::clear | ( | ) |
| std::vector< AwardRecord > AwardSystem::forLeague | ( | LeagueID | league_id, |
| std::uint16_t | season_year | ||
| ) | const |
Honours given in a league in a season (all months), in award order.
|
inline |
Every honour, oldest first.
| std::vector< AwardRecord > AwardSystem::honoursFor | ( | PlayerID | player_id | ) | const |
Honours of a player, newest first.
| void AwardSystem::load | ( | const std::shared_ptr< DatabaseConnection > & | db_conn | ) |
|
inline |
| void AwardSystem::onMatchPlayed | ( | const GameData & | gamedata, |
| const MatchReport & | report, | ||
| float | home_expected, | ||
| float | away_expected | ||
| ) |
Adds a league match (ratings already set).
| std::vector< AwardRecord > AwardSystem::onMonthStart | ( | GameData & | gamedata, |
| const GameDateValue & | date, | ||
| TeamID | managed_team_id, | ||
| Inbox & | inbox, | ||
| BoardState & | board | ||
| ) |
First day of a month: awards the previous month (and on 1 June the season), applies the effects and posts the managed league's news.
| void AwardSystem::save | ( | const std::shared_ptr< DatabaseConnection > & | db_conn | ) | const |
Individual season honours won by a player at a club.
|
inline |
| float AwardSystem::valueMultiplier | ( | PlayerID | player_id, |
| const GameDateValue & | today | ||
| ) | const |
Market value multiplier of a player (see Awards::valueMultiplier).
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |