90float settle(
float previous,
float target);
146 std::optional<TeamID> rival);
148 void load(
const std::shared_ptr<DatabaseConnection>& db_conn);
150 void save(
const std::shared_ptr<DatabaseConnection>& db_conn)
const;
Manages the match calendar for a season.
Definition calendar.h:133
Manages the SQLite database connection and transaction lifecycle.
Definition database_connection.h:24
Singleton class that acts as an in-memory cache for the database state.
Definition gamedata.h:43
The managed club's supporters: their mood is recomputed once a week from the facts and nudges the boa...
Definition supporters.h:114
void save(const std::shared_ptr< DatabaseConnection > &db_conn) const
Definition supporters.cpp:316
TeamID team_id
Definition supporters.h:153
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)
Definition supporters.cpp:179
std::int32_t updated_day
Definition supporters.h:154
float update(TeamID new_team_id, std::int32_t day, const SupporterFacts &facts)
Definition supporters.cpp:166
std::int32_t updatedOn() const
Definition supporters.h:121
void load(const std::shared_ptr< DatabaseConnection > &db_conn)
Definition supporters.cpp:286
const SupporterMood & mood() const
Definition supporters.h:117
SupporterMood current
Definition supporters.h:155
void onDayEnd(const GameData &gamedata, const GameDateValue &date, TeamID managed_team_id, const Calendar &calendar, const TransferMarket &transfers, WorldSimulation &world)
Definition supporters.cpp:267
TeamID team() const
Definition supporters.h:119
Deals, loans, pre-contracts, payments and history of the market.
Definition transfer_market.h:221
Everything that happens between matches.
Definition world_simulation.h:104
bool day
Definition match_stadium_3d.cpp:447
Pure supporter rules (no game state), unit tested in isolation.
Definition supporters.h:70
constexpr float NEUTRAL
Definition supporters.h:72
const char * reasonKey(const SupporterReason &reason)
Definition supporters.cpp:138
constexpr float MAX_BOARD_NUDGE
Definition supporters.h:74
SupporterMood evaluate(const SupporterFacts &facts)
Definition supporters.cpp:68
float boardNudge(float index)
Definition supporters.cpp:120
constexpr int STAR_RANK
Definition supporters.h:80
constexpr float BOARD_DEAD_ZONE
Definition supporters.h:76
const char * moodKey(float index)
Definition supporters.cpp:129
float settle(float previous, float target)
Definition supporters.cpp:115
constexpr int STAR_WINDOW_DAYS
Definition supporters.h:78
int index
Definition runtime_editor.cpp:94
The board's view of the manager of the managed club.
Definition board.h:69
Represents a specific date in the game world.
Definition gamedate.h:20
Observable facts the supporters judge the club by.
Definition supporters.h:39
int star_sales
Definition supporters.h:47
std::vector< float > result_deltas
Definition supporters.h:41
float ticket_ratio
Definition supporters.h:45
int star_signings
Definition supporters.h:48
std::vector< int > derby_points
Definition supporters.h:43
The supporters' mood: a 0-100 index and why it is there.
Definition supporters.h:60
std::vector< SupporterReason > reasons
Definition supporters.h:63
float index
Definition supporters.h:61
One factor and how many index points it is worth.
Definition supporters.h:53
SupporterFactor factor
Definition supporters.h:54
float points
Definition supporters.h:55
SupporterFactor
What moves the supporters (values are persisted).
Definition supporters.h:28
uint16_t TeamID
Type alias for Team identifiers.
Definition types.h:18