117std::int64_t
tourFee(
double season_income, std::uint8_t opponent_reputation);
156 TeamID opponent_id,
bool home,
bool tour,
196 void load(
const std::shared_ptr<DatabaseConnection>& db_conn);
197 void save(
const std::shared_ptr<DatabaseConnection>& db_conn)
const;
201 TeamID managed_team_id)
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
Chronological list of messages with read tracking.
Definition inbox.h:113
Friendlies, tour and training camp of the managed club.
Definition preseason.h:135
void load(const std::shared_ptr< DatabaseConnection > &db_conn)
Definition preseason.cpp:485
void clear()
Definition preseason.cpp:483
void save(const std::shared_ptr< DatabaseConnection > &db_conn) const
Definition preseason.cpp:514
CampQuote campQuote(const GameData &gamedata, const Calendar &calendar, TeamID managed_team_id, TrainingCamp camp) const
Definition preseason.cpp:357
const PreseasonState & getState() const
Definition preseason.h:193
PreseasonState state
Definition preseason.h:203
std::optional< GameDateValue > firstFriendly(const Calendar &calendar, TeamID managed_team_id) const
Definition preseason.cpp:180
void onSeasonStart(std::uint16_t season_year)
Definition preseason.cpp:477
void onMatchPlayed(GameData &gamedata, const MatchReport &report, TeamID managed_team_id)
Definition preseason.cpp:449
std::vector< OpponentOption > opponents(const GameData &gamedata, const Calendar &calendar, TeamID managed_team_id, const GameDateValue &date, OpponentLevel level, bool abroad) const
Definition preseason.cpp:191
std::vector< FriendlySuggestion > suggest(const GameData &gamedata, const Calendar &calendar, TeamID managed_team_id, const GameDateValue &today) const
Definition preseason.cpp:314
TrainingCamp suggestCamp(const GameData &gamedata, const Calendar &calendar, TeamID managed_team_id, const GameDateValue &today) const
Definition preseason.cpp:369
bool bookCamp(GameData &gamedata, const Calendar &calendar, TeamID managed_team_id, TrainingCamp camp, const GameDateValue &today)
Definition preseason.cpp:395
bool setFriendly(Calendar &calendar, const GameData &gamedata, TeamID managed_team_id, const GameDateValue &date, TeamID opponent_id, bool home, bool tour, const GameDateValue &today)
Definition preseason.cpp:242
void onDay(GameData &gamedata, const GameDateValue &date, TeamID managed_team_id, Inbox &inbox)
Definition preseason.cpp:417
std::vector< FriendlySlot > friendlies(const Calendar &calendar, TeamID managed_team_id, const GameDateValue &today) const
Definition preseason.cpp:157
Pricing of camps and tours.
Definition preseason.cpp:97
bool levelMatches(OpponentLevel level, std::uint8_t own, std::uint8_t other)
Definition preseason.cpp:139
std::int64_t tourFee(double season_income, std::uint8_t opponent_reputation)
Definition preseason.cpp:130
constexpr int LEVEL_GAP
Definition preseason.h:109
constexpr int CAMP_DAYS
Definition preseason.h:110
CampQuote campQuote(TrainingCamp camp, double season_income, const GameDateValue &first_friendly)
Definition preseason.cpp:98
constexpr int TOUR_MATCHES_FOR_REPUTATION
Definition preseason.h:107
TrainingCamp
Pre-season training camp (values are persisted).
Definition preseason.h:27
OpponentLevel
Opponent strength relative to the managed club.
Definition preseason.h:36
Cost, dates and effect of a training camp.
Definition preseason.h:63
GameDateValue end
Definition preseason.h:70
TrainingCamp camp
Definition preseason.h:64
GameDateValue start
Definition preseason.h:69
float sharpness
Definition preseason.h:66
float familiarity
Definition preseason.h:67
bool available
Definition preseason.h:71
std::int64_t cost
Definition preseason.h:65
float morale
Definition preseason.h:68
A pre-season friendly of the managed club.
Definition preseason.h:45
TeamID opponent_id
Definition preseason.h:47
GameDateValue date
Definition preseason.h:46
bool tour
Definition preseason.h:49
bool editable
Definition preseason.h:50
bool home
Definition preseason.h:48
A suggested friendly (the assistant's plan).
Definition preseason.h:76
bool home
Definition preseason.h:79
GameDateValue date
Definition preseason.h:77
TeamID opponent_id
Definition preseason.h:78
Represents a specific date in the game world.
Definition gamedate.h:20
Structured summary of a played fixture, persisted per fixture.
Definition match_report.h:93
A club that can be invited to a friendly.
Definition preseason.h:55
TeamID team_id
Definition preseason.h:56
std::uint8_t reputation
Definition preseason.h:57
bool abroad
Definition preseason.h:58
The season's pre-season choices (persisted).
Definition preseason.h:84
std::int64_t camp_cost
Definition preseason.h:87
std::uint16_t season_year
Definition preseason.h:85
std::uint8_t tour_matches
Definition preseason.h:91
GameDateValue camp_end
Definition preseason.h:88
std::vector< GameDateValue > tour_dates
Definition preseason.h:90
TrainingCamp camp
Definition preseason.h:86
bool tour_reputation
Definition preseason.h:92
bool camp_applied
Definition preseason.h:89
uint16_t TeamID
Type alias for Team identifiers.
Definition types.h:18