Modern UI contract: calendar read
club_calendar projects the season calendar of a club: the competitions of each day and the club's league matches on the day of their round, or on the replay day when moved or postponed. The calendar read lists a date range of it with fixtures, status and results. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6e400d708c
commit
d3d526c2e4
5 files changed
+138
No files matched your search
@@ -59,4 +59,26 @@ std::vector<LeagueMatchRef> moved_matches(const ModernState& g, int manager);
|
||||
// freed. Returns false if there is no such match.
|
||||
bool undo_reschedule(ModernState& g, int manager, int day);
|
||||
|
||||
|
||||
// The season calendar of a club for the interface (pure, no random draw): per calendar day
|
||||
// (0 = the season's first day, as CompetitionCalendar) the calendar word, the day's
|
||||
// competitions (day_competitions) and whether the club has a friendly, plus the club's league
|
||||
// matches. A league match sits on the day of its round (the rounds counted along the league's
|
||||
// calendar bit, as advance_league_rounds does); one with a replay entry (moved, 0xCE, or
|
||||
// postponed in winter, 0xCD) sits on the replay day with `original_day` set to its planned day.
|
||||
struct ClubCalendarMatch {
|
||||
int league = 0, round = 0, match = 0; // 0-based round, index in the round's fixture list
|
||||
int home = 0, away = 0;
|
||||
int original_day = -1; // the planned day of a replay, else -1
|
||||
uint8_t result = 0xcc; // result byte: home << 4 | away, 0xCC..0xCF open
|
||||
};
|
||||
struct ClubCalendarDay {
|
||||
int day = 0;
|
||||
uint16_t word = 0;
|
||||
uint32_t competitions = 0;
|
||||
bool friendly = false;
|
||||
std::vector<ClubCalendarMatch> matches;
|
||||
};
|
||||
std::vector<ClubCalendarDay> club_calendar(const ModernState& g, int team);
|
||||
|
||||
} // namespace bmh::modern
|
||||
Reference in new issue
Block a user