Player12
An open source football management simulator
Loading...
Searching...
No Matches
timeline_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 <cstddef>
12#include <cstdint>
13#include <filesystem>
14#include <optional>
15#include <string>
16#include <utility>
17#include <vector>
18
21
29{
30 public:
31 enum class Zoom : std::uint8_t
32 {
33 SEASON,
34 MONTH
35 };
36
37 explicit TimelineScene(GUIView* parent);
38
39 void update(float /*deltaTime*/) override
40 {
41 // Rendering reads current state; there is no per-frame update work.
42 }
43 [[nodiscard]] SceneID getID() const override { return SceneID::TIMELINE; }
44
45 [[nodiscard]] std::size_t entryCount() const { return entries.size(); }
46 [[nodiscard]] std::size_t groupCount() const { return groups.size(); }
47 void setZoom(Zoom value);
52 std::optional<std::filesystem::path> exportJournal();
53
54 protected:
55 void renderContent() override;
56 [[nodiscard]] NavSection navSection() const override
57 {
59 }
60 void refresh() override;
61
62 private:
63 struct Row
64 {
65 std::string date;
66 std::string kind;
67 std::string text;
68 std::string player;
69 std::string club;
70 };
71
72 struct Group
73 {
74 std::string label;
75 std::vector<std::size_t> entries;
76 };
77
78 void regroup();
79 void renderSummary() const;
80 void renderControls();
81 void renderEntry(std::size_t index);
82
83 std::vector<TimelineEntry> entries;
84 std::vector<Row> rows;
85 std::vector<Group> groups;
87 std::vector<std::pair<TeamID, std::string>> clubs;
89 std::string club_label;
91 int zoom_index = 0;
92 std::string clubs_value;
93 std::string matches_value;
94 std::string matches_note;
95 std::string win_rate_value;
96 std::string trophies_value;
97};
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
The manager's career across every club: spells, trophies, honours, promotions and relegations,...
Definition timeline_scene.h:29
std::vector< TimelineEntry > entries
Definition timeline_scene.h:83
std::string win_rate_value
Definition timeline_scene.h:95
void refresh() override
Rebuilds cached view models from the game state.
Definition timeline_scene.cpp:50
void renderControls()
Definition timeline_scene.cpp:181
int zoom_index
Definition timeline_scene.h:91
SceneID getID() const override
Gets the ID of the scene.
Definition timeline_scene.h:43
std::optional< std::filesystem::path > exportJournal()
Definition timeline_scene.cpp:145
std::string club_label
Definition timeline_scene.h:89
std::string matches_value
Definition timeline_scene.h:93
std::vector< std::pair< TeamID, std::string > > clubs
Definition timeline_scene.h:87
std::size_t entryCount() const
Definition timeline_scene.h:45
void renderContent() override
Draws the page body inside the content region.
Definition timeline_scene.cpp:278
Zoom
Definition timeline_scene.h:32
NavSection navSection() const override
Sidebar entry highlighted for this screen.
Definition timeline_scene.h:56
void setZoom(Zoom value)
Definition timeline_scene.cpp:112
std::string clubs_value
Definition timeline_scene.h:92
std::size_t groupCount() const
Definition timeline_scene.h:46
Zoom zoom
Definition timeline_scene.h:90
void update(float) override
Updates scene logic.
Definition timeline_scene.h:39
void renderEntry(std::size_t index)
Definition timeline_scene.cpp:222
void renderSummary() const
Definition timeline_scene.cpp:162
std::string matches_note
Definition timeline_scene.h:94
TeamID club_filter
Definition timeline_scene.h:88
void regroup()
Definition timeline_scene.cpp:119
std::vector< Row > rows
Definition timeline_scene.h:84
std::string trophies_value
Definition timeline_scene.h:96
std::vector< Group > groups
Definition timeline_scene.h:85
SceneID
Identifiers for different GUI scenes.
Definition gui_scene.h:24
NavSection
Screens of the management shell. The sidebar groups them into a few hubs (Home, Inbox,...
Definition nav_history.h:26
int index
Definition runtime_editor.cpp:94
Definition timeline_scene.h:73
std::string label
Definition timeline_scene.h:74
std::vector< std::size_t > entries
Definition timeline_scene.h:75
Definition timeline_scene.h:64
std::string player
Definition timeline_scene.h:68
std::string kind
Definition timeline_scene.h:66
std::string club
Definition timeline_scene.h:69
std::string text
Definition timeline_scene.h:67
std::string date
Definition timeline_scene.h:65
uint16_t TeamID
Type alias for Team identifiers.
Definition types.h:18