|
Player12
An open source football management simulator
|
The managed club's supporters: their mood is recomputed once a week from the facts and nudges the board's confidence a little. More...
#include <supporters.h>
Public Member Functions | |
| const SupporterMood & | mood () const |
| TeamID | team () const |
| std::int32_t | updatedOn () const |
| void | onDayEnd (const GameData &gamedata, const GameDateValue &date, TeamID managed_team_id, const Calendar &calendar, const TransferMarket &transfers, WorldSimulation &world) |
| float | update (TeamID new_team_id, std::int32_t day, const SupporterFacts &facts) |
| void | load (const std::shared_ptr< DatabaseConnection > &db_conn) |
| void | save (const std::shared_ptr< DatabaseConnection > &db_conn) const |
Static Public Member Functions | |
| static SupporterFacts | gather (const GameData &gamedata, const GameDateValue &date, TeamID team_id, const BoardState &board, const Calendar &calendar, const TransferMarket &transfers, std::optional< TeamID > rival) |
Private Attributes | |
| TeamID | team_id = 0 |
| std::int32_t | updated_day = 0 |
| SupporterMood | current |
The managed club's supporters: their mood is recomputed once a week from the facts and nudges the board's confidence a little.
Persisted in SupporterMood (assets/db/schema.sql) inside the game's save transaction.
|
static |
The facts about team_id on date.
| void Supporters::load | ( | const std::shared_ptr< DatabaseConnection > & | db_conn | ) |
|
inline |
The latest weekly mood (meaningful once team() is the managed club).
| void Supporters::onDayEnd | ( | const GameData & | gamedata, |
| const GameDateValue & | date, | ||
| TeamID | managed_team_id, | ||
| const Calendar & | calendar, | ||
| const TransferMarket & | transfers, | ||
| WorldSimulation & | world | ||
| ) |
Closes date: once a week (and at once for a new club) the facts are gathered, the mood moves towards them and the board's confidence is nudged by SupporterModel::boardNudge().
| void Supporters::save | ( | const std::shared_ptr< DatabaseConnection > & | db_conn | ) | const |
Writes the state; must run inside the caller's transaction.
|
inline |
Club the mood belongs to (0: none yet).
| float Supporters::update | ( | TeamID | new_team_id, |
| std::int32_t | day, | ||
| const SupporterFacts & | facts | ||
| ) |
Moves the mood of team_id towards the mood facts point to on day (a new club starts there) and returns the board nudge, 0 for a new club.
|
inline |
Day ordinal of the latest recomputation.
|
private |
|
private |
|
private |