|
Player12
An open source football management simulator
|
Friendlies, tour and training camp of the managed club. More...
#include <preseason.h>
Public Member Functions | |
| std::vector< FriendlySlot > | friendlies (const Calendar &calendar, TeamID managed_team_id, const GameDateValue &today) const |
| std::vector< OpponentOption > | opponents (const GameData &gamedata, const Calendar &calendar, TeamID managed_team_id, const GameDateValue &date, OpponentLevel level, bool abroad) const |
| bool | setFriendly (Calendar &calendar, const GameData &gamedata, TeamID managed_team_id, const GameDateValue &date, TeamID opponent_id, bool home, bool tour, const GameDateValue &today) |
| std::vector< FriendlySuggestion > | suggest (const GameData &gamedata, const Calendar &calendar, TeamID managed_team_id, const GameDateValue &today) const |
| TrainingCamp | suggestCamp (const GameData &gamedata, const Calendar &calendar, TeamID managed_team_id, const GameDateValue &today) const |
| CampQuote | campQuote (const GameData &gamedata, const Calendar &calendar, TeamID managed_team_id, TrainingCamp camp) const |
| bool | bookCamp (GameData &gamedata, const Calendar &calendar, TeamID managed_team_id, TrainingCamp camp, const GameDateValue &today) |
| void | onDay (GameData &gamedata, const GameDateValue &date, TeamID managed_team_id, Inbox &inbox) |
| void | onMatchPlayed (GameData &gamedata, const MatchReport &report, TeamID managed_team_id) |
| void | onSeasonStart (std::uint16_t season_year) |
| const PreseasonState & | getState () const |
| void | clear () |
| void | load (const std::shared_ptr< DatabaseConnection > &db_conn) |
| void | save (const std::shared_ptr< DatabaseConnection > &db_conn) const |
Private Member Functions | |
| std::optional< GameDateValue > | firstFriendly (const Calendar &calendar, TeamID managed_team_id) const |
Private Attributes | |
| PreseasonState | state |
Friendlies, tour and training camp of the managed club.
Every club plays the generated pre-season friendlies, one a week (spread from Tuesday to Sunday). Choosing an opponent swaps fixtures within that week (the managed club's old opponent meets the new opponent's old one on the day the new opponent was to play), so nobody plays twice a week or loses a match. Away friendlies against clubs from another country can be booked as tour dates.
| bool PreseasonPlanner::bookCamp | ( | GameData & | gamedata, |
| const Calendar & | calendar, | ||
| TeamID | managed_team_id, | ||
| TrainingCamp | camp, | ||
| const GameDateValue & | today | ||
| ) |
Books (or with None cancels, refunded) the camp before it starts; the cost is paid today.
| CampQuote PreseasonPlanner::campQuote | ( | const GameData & | gamedata, |
| const Calendar & | calendar, | ||
| TeamID | managed_team_id, | ||
| TrainingCamp | camp | ||
| ) | const |
| void PreseasonPlanner::clear | ( | ) |
|
private |
| std::vector< FriendlySlot > PreseasonPlanner::friendlies | ( | const Calendar & | calendar, |
| TeamID | managed_team_id, | ||
| const GameDateValue & | today | ||
| ) | const |
The managed club's friendlies before its first competitive match.
|
inline |
| void PreseasonPlanner::load | ( | const std::shared_ptr< DatabaseConnection > & | db_conn | ) |
| void PreseasonPlanner::onDay | ( | GameData & | gamedata, |
| const GameDateValue & | date, | ||
| TeamID | managed_team_id, | ||
| Inbox & | inbox | ||
| ) |
Applies the camp on its last day.
| void PreseasonPlanner::onMatchPlayed | ( | GameData & | gamedata, |
| const MatchReport & | report, | ||
| TeamID | managed_team_id | ||
| ) |
Tour fees and the tour's reputation point.
| void PreseasonPlanner::onSeasonStart | ( | std::uint16_t | season_year | ) |
A new season: last season's choices are archived.
| std::vector< OpponentOption > PreseasonPlanner::opponents | ( | const GameData & | gamedata, |
| const Calendar & | calendar, | ||
| TeamID | managed_team_id, | ||
| const GameDateValue & | date, | ||
| OpponentLevel | level, | ||
| bool | abroad | ||
| ) | const |
Clubs free to be swapped in on date (their only match that week is an unplayed friendly, or none), best fit first.
| void PreseasonPlanner::save | ( | const std::shared_ptr< DatabaseConnection > & | db_conn | ) | const |
| bool PreseasonPlanner::setFriendly | ( | Calendar & | calendar, |
| const GameData & | gamedata, | ||
| TeamID | managed_team_id, | ||
| const GameDateValue & | date, | ||
| TeamID | opponent_id, | ||
| bool | home, | ||
| bool | tour, | ||
| const GameDateValue & | today | ||
| ) |
Sets the opponent and venue of the friendly on date; tour books it as a tour date (only away against a club from another country).
| std::vector< FriendlySuggestion > PreseasonPlanner::suggest | ( | const GameData & | gamedata, |
| const Calendar & | calendar, | ||
| TeamID | managed_team_id, | ||
| const GameDateValue & | today | ||
| ) | const |
The assistant's plan: weaker and similar sides at home, a stronger one away (abroad for clubs with a following).
| TrainingCamp PreseasonPlanner::suggestCamp | ( | const GameData & | gamedata, |
| const Calendar & | calendar, | ||
| TeamID | managed_team_id, | ||
| const GameDateValue & | today | ||
| ) | const |
The camp the assistant recommends for this club's finances.
|
private |