Player12
An open source football management simulator
Loading...
Searching...
No Matches
calendar_scene.h
Go to the documentation of this file.
1// -----------------------------------------------------------------------------
2// Football Management Project
3// Copyright (c) 2025 - 2026 Flavio Milinanni. All Rights Reserved.
4//
5// This file is part of the Football Management Project.
6// See the LICENSE file in the project root.
7// -----------------------------------------------------------------------------
8
9#pragma once
10
11#include <array>
12#include <cstdint>
13#include <string>
14#include <vector>
15
17#include "model/season_agenda.h"
18
25{
26 public:
27 explicit CalendarScene(GUIView* parent);
28
29 void update(float deltaTime) override;
30 [[nodiscard]] SceneID getID() const override { return SceneID::CALENDAR; }
31
32 protected:
33 void renderContent() override;
34 [[nodiscard]] NavSection navSection() const override
35 {
37 }
38 void refresh() override;
39
40 private:
42
44 struct Entry
45 {
47 std::string title;
48 std::string detail;
49 std::string score;
50 std::string line;
51 std::string date;
52 int outcome = 0;
54 };
55
57 struct Day
58 {
59 int fixture = -1;
60 std::uint16_t kinds = 0;
61 bool international = false;
62 bool winter = false;
63 };
64
65 void showMonth(int year, int month);
66 void renderToolbar();
67 void renderGrid(float width);
68 void renderAgenda(float width);
69 void renderDay(float width);
70 [[nodiscard]] bool isToday(int day) const;
71
72 std::vector<Entry> entries;
75 int shown_year = 0;
76 int shown_month = 0;
78 int first_weekday = 0;
79 std::array<Day, 32> days{};
80 std::vector<std::size_t> month_entries;
81 int selected_day = 0;
82 std::string month_title;
83};
Season calendar: a month grid with the club's fixtures, breaks and club events, the month's agenda an...
Definition calendar_scene.h:25
std::vector< Entry > entries
Definition calendar_scene.h:72
std::array< Day, 32 > days
Definition calendar_scene.h:79
int first_weekday
Definition calendar_scene.h:78
int days_in_month
Definition calendar_scene.h:77
GameDateValue season_first
Definition calendar_scene.h:73
std::vector< std::size_t > month_entries
Definition calendar_scene.h:80
SceneID getID() const override
Gets the ID of the scene.
Definition calendar_scene.h:30
int shown_month
Definition calendar_scene.h:76
void renderAgenda(float width)
Definition calendar_scene.cpp:563
int shown_year
Definition calendar_scene.h:75
int selected_day
Definition calendar_scene.h:81
void refresh() override
Rebuilds cached view models from the game state.
Definition calendar_scene.cpp:108
GameDateValue today
Definition calendar_scene.h:74
void renderGrid(float width)
Definition calendar_scene.cpp:308
void update(float deltaTime) override
Updates scene logic.
Definition calendar_scene.cpp:103
void renderToolbar()
Definition calendar_scene.cpp:272
void renderDay(float width)
Definition calendar_scene.cpp:497
bool isToday(int day) const
Definition calendar_scene.cpp:243
void renderContent() override
Draws the page body inside the content region.
Definition calendar_scene.cpp:249
std::string month_title
Definition calendar_scene.h:82
NavSection navSection() const override
Sidebar entry highlighted for this screen.
Definition calendar_scene.h:34
void showMonth(int year, int month)
Definition calendar_scene.cpp:204
friend class GameFlowTest_GUIFlowLifecycle_Test
Definition calendar_scene.h:41
Main view manager for the GUI. Handles scenes and overlays.
Definition gui_view.h:29
Base class for every in-career screen.
Definition management_scene.h:93
SceneID
Identifiers for different GUI scenes.
Definition gui_scene.h:24
bool day
Definition match_stadium_3d.cpp:447
NavSection
Screens of the management shell. The sidebar groups them into a few hubs (Home, Inbox,...
Definition nav_history.h:26
One entry of the season agenda.
Definition season_agenda.h:37
What happens on one day of the shown month.
Definition calendar_scene.h:58
std::uint16_t kinds
Definition calendar_scene.h:60
bool winter
Definition calendar_scene.h:62
bool international
Definition calendar_scene.h:61
int fixture
Definition calendar_scene.h:59
One agenda entry, pre-formatted.
Definition calendar_scene.h:45
TeamID opponent
Definition calendar_scene.h:53
std::string score
Definition calendar_scene.h:49
int outcome
Definition calendar_scene.h:52
std::string line
Definition calendar_scene.h:50
std::string detail
Definition calendar_scene.h:48
AgendaEvent event
Definition calendar_scene.h:46
std::string date
Definition calendar_scene.h:51
std::string title
Definition calendar_scene.h:47
Represents a specific date in the game world.
Definition gamedate.h:20
uint16_t TeamID
Type alias for Team identifiers.
Definition types.h:18