|
Player12
An open source football management simulator
|
Season date rules shared by the calendar and the competitions. More...
Classes | |
| struct | InternationalWindow |
| Days in which clubs release players to their national teams. More... | |
Functions | |
| int | restDays (MatchType earlier, MatchType later) |
| uint8_t | dayOfWeek (const GameDateValue &date) |
| Weekday of a date, 0 = Monday ... 6 = Sunday. | |
| GameDateValue | addDays (const GameDateValue &date, int days) |
| Adds (or subtracts) days in O(1). | |
| uint16_t | seasonStartYear (const GameDateValue &date) |
Calendar year in which the season containing date started. | |
| GameDateValue | leagueStart (uint16_t season_year) |
| First league Saturday (first Saturday on or after 15 August). | |
| GameDateValue | leagueEnd (uint16_t season_year) |
| Last regular league Saturday (on or before 24 May). | |
| std::vector< InternationalWindow > | internationalWindows (uint16_t season_year) |
Windows of the season starting in season_year, by date. | |
| bool | isInternationalBreak (const GameDateValue &date) |
| bool | isWinterBreak (const GameDateValue &date) |
| std::vector< GameDateValue > | continentalWeeks (uint16_t season_year) |
| Tuesday of every continental club week (see CONTINENTAL_WEEKS). Continental matches are played Tuesday to Thursday; domestic midweek rounds and cup ties avoid these weeks. | |
| bool | isContinentalWeek (const GameDateValue &date) |
| True from Tuesday to Thursday of a continental club week. | |
| bool | isBlackout (const GameDateValue &date) |
| No competitive fixtures may be scheduled on this date. | |
| std::vector< GameDateValue > | leagueRoundDates (uint16_t season_year, size_t rounds, uint8_t variant=0) |
| Anchor date of each league round: a Saturday for weekend rounds (matches spread from Friday to Monday) or a Wednesday for midweek rounds (Tuesday and Wednesday). | |
| std::vector< GameDateValue > | cupRoundDates (uint16_t season_year, size_t rounds) |
| Date of each cup round; the last one (the final) is a Saturday. | |
| std::vector< GameDateValue > | friendlyDates (const GameDateValue &from, size_t count) |
Saturdays of the pre-season friendly weeks after from and before the league; each week's friendlies are spread from Tuesday to Sunday. | |
| GameDateValue | nextFreeMidweek (const GameDateValue &date) |
First Wednesday after date that is not in a break. | |
Variables | |
| constexpr uint8_t | MONDAY = 0 |
| constexpr uint8_t | TUESDAY = 1 |
| constexpr uint8_t | WEDNESDAY = 2 |
| constexpr uint8_t | THURSDAY = 3 |
| constexpr uint8_t | FRIDAY = 4 |
| constexpr uint8_t | SATURDAY = 5 |
| constexpr uint8_t | SUNDAY = 6 |
| constexpr int | MIN_REST_DAYS = 2 |
| constexpr int | MIN_REST_BEFORE_TIE = 3 |
| constexpr uint8_t | SEASON_START_MONTH = 7 |
| constexpr size_t | MAX_CUP_ROUNDS = 8 |
| constexpr size_t | PRESEASON_FRIENDLIES = 4 |
| constexpr size_t | CONTINENTAL_WEEKS = 16 |
Season date rules shared by the calendar and the competitions.
A season runs from July (friendlies) to May. Each league round is spread over a long weekend (Friday to Monday) or, for the few midweek rounds, over Tuesday and Wednesday, following the league's own day pattern (round_days in leagues.json). Cups are played on Wednesdays with the final on the Saturday after the last league weekend. Continental club competitions use their own Tuesday-Thursday weeks. There is a winter break and the international windows (September/October, November, March and June) during which no competitive club matches are played.
| GameDateValue SeasonCalendar::addDays | ( | const GameDateValue & | date, |
| int | days | ||
| ) |
Adds (or subtracts) days in O(1).
| std::vector< GameDateValue > SeasonCalendar::continentalWeeks | ( | uint16_t | season_year | ) |
Tuesday of every continental club week (see CONTINENTAL_WEEKS). Continental matches are played Tuesday to Thursday; domestic midweek rounds and cup ties avoid these weeks.
| std::vector< GameDateValue > SeasonCalendar::cupRoundDates | ( | uint16_t | season_year, |
| size_t | rounds | ||
| ) |
Date of each cup round; the last one (the final) is a Saturday.
| uint8_t SeasonCalendar::dayOfWeek | ( | const GameDateValue & | date | ) |
Weekday of a date, 0 = Monday ... 6 = Sunday.
| std::vector< GameDateValue > SeasonCalendar::friendlyDates | ( | const GameDateValue & | from, |
| size_t | count | ||
| ) |
Saturdays of the pre-season friendly weeks after from and before the league; each week's friendlies are spread from Tuesday to Sunday.
| std::vector< SeasonCalendar::InternationalWindow > SeasonCalendar::internationalWindows | ( | uint16_t | season_year | ) |
Windows of the season starting in season_year, by date.
| bool SeasonCalendar::isBlackout | ( | const GameDateValue & | date | ) |
No competitive fixtures may be scheduled on this date.
| bool SeasonCalendar::isContinentalWeek | ( | const GameDateValue & | date | ) |
True from Tuesday to Thursday of a continental club week.
| bool SeasonCalendar::isInternationalBreak | ( | const GameDateValue & | date | ) |
| bool SeasonCalendar::isWinterBreak | ( | const GameDateValue & | date | ) |
| GameDateValue SeasonCalendar::leagueEnd | ( | uint16_t | season_year | ) |
Last regular league Saturday (on or before 24 May).
| std::vector< GameDateValue > SeasonCalendar::leagueRoundDates | ( | uint16_t | season_year, |
| size_t | rounds, | ||
| uint8_t | variant = 0 |
||
| ) |
Anchor date of each league round: a Saturday for weekend rounds (matches spread from Friday to Monday) or a Wednesday for midweek rounds (Tuesday and Wednesday).
| variant | 0 for top divisions; lower divisions (1) play the midweek rounds they need in other weeks (or on up to two weekends after the top flight has finished), so the midweek days of the two tiers do not pile up. |
| GameDateValue SeasonCalendar::leagueStart | ( | uint16_t | season_year | ) |
First league Saturday (first Saturday on or after 15 August).
| GameDateValue SeasonCalendar::nextFreeMidweek | ( | const GameDateValue & | date | ) |
First Wednesday after date that is not in a break.
Days a club needs between an earlier and a later competitive match: MIN_REST_BEFORE_TIE from a league match to a cup or continental tie, MIN_REST_DAYS otherwise.
| uint16_t SeasonCalendar::seasonStartYear | ( | const GameDateValue & | date | ) |
Calendar year in which the season containing date started.
|
constexpr |
Continental club weeks per season: eight league-phase matchdays and two legs each of the play-off, round of 16, quarter- and semi-finals.
|
constexpr |
|
constexpr |
|
constexpr |
Fewest days between a league match and a midweek cup or continental tie that follows it (two free days in between).
|
constexpr |
Fewest days between two competitive matches of a club (48 hours).
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |
|
constexpr |