Player12
An open source football management simulator
Loading...
Searching...
No Matches
records_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 <cstdint>
12#include <string>
13#include <vector>
14
16
23{
24 public:
26 enum class Tab : int
27 {
28 CLUB = 0,
29 LEAGUE,
32 };
33
34 explicit RecordsScene(GUIView* parent);
35
36 void update(float /*deltaTime*/) override
37 {
38 // Rendering reads current state; there is no per-frame update work.
39 }
40 [[nodiscard]] SceneID getID() const override { return SceneID::RECORDS; }
41
43 void showTab(Tab tab)
44 {
45 active_tab = tab;
46 refresh();
47 }
48
49 protected:
50 void renderContent() override;
51 [[nodiscard]] NavSection navSection() const override
52 {
54 }
55 void refresh() override;
56
57 private:
59
62 {
63 std::string title;
64 std::string value;
65 std::string holder;
66 std::string when;
68 };
69
72 {
74 std::string name;
75 std::string span;
76 std::string figure;
77 std::string detail;
78 };
79
81 struct TableLine
82 {
84 std::string club;
85 uint32_t played = 0;
86 uint32_t won = 0;
87 uint32_t drawn = 0;
88 uint32_t lost = 0;
89 uint32_t goals_for = 0;
90 uint32_t goals_against = 0;
91 uint32_t points = 0;
92 };
93
94 void renderClubSelector();
96 void renderRecords(const char* id, const char* title,
97 const std::vector<RecordLine>& lines, float width);
98 void renderPlayers(const char* id, const char* title,
99 const std::vector<PlayerLine>& lines, float width);
100 void renderAllTime();
101 void renderHallOfFame();
102
106 std::vector<RecordLine> club_records;
107 std::vector<RecordLine> league_records;
108 std::vector<PlayerLine> scorers;
109 std::vector<PlayerLine> appearances;
110 std::vector<PlayerLine> legends;
111 std::vector<TableLine> all_time;
112};
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
Records book: club records with the club's all-time scorers and appearance makers,...
Definition records_scene.h:23
void renderPlayers(const char *id, const char *title, const std::vector< PlayerLine > &lines, float width)
Definition records_scene.cpp:327
void renderRecords(const char *id, const char *title, const std::vector< RecordLine > &lines, float width)
Definition records_scene.cpp:271
void renderClubSelector()
Definition records_scene.cpp:225
LeagueID league_id
Definition records_scene.h:105
void update(float) override
Updates scene logic.
Definition records_scene.h:36
Tab
Tabs of the records book.
Definition records_scene.h:27
std::vector< RecordLine > league_records
Definition records_scene.h:107
std::vector< PlayerLine > scorers
Definition records_scene.h:108
void renderLeagueSelector()
Definition records_scene.cpp:249
void showTab(Tab tab)
Shows a tab (e.g. from another screen).
Definition records_scene.h:43
std::vector< RecordLine > club_records
Definition records_scene.h:106
std::vector< PlayerLine > appearances
Definition records_scene.h:109
NavSection navSection() const override
Sidebar entry highlighted for this screen.
Definition records_scene.h:51
void refresh() override
Rebuilds cached view models from the game state.
Definition records_scene.cpp:54
std::vector< PlayerLine > legends
Definition records_scene.h:110
void renderContent() override
Draws the page body inside the content region.
Definition records_scene.cpp:176
void renderAllTime()
Definition records_scene.cpp:384
void renderHallOfFame()
Definition records_scene.cpp:453
Tab active_tab
Definition records_scene.h:103
std::vector< TableLine > all_time
Definition records_scene.h:111
SceneID getID() const override
Gets the ID of the scene.
Definition records_scene.h:40
friend class GameFlowTest_GUIFlowLifecycle_Test
Definition records_scene.h:58
TeamID club_id
Definition records_scene.h:104
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
One formatted player total.
Definition records_scene.h:72
std::string name
Definition records_scene.h:74
std::string detail
Definition records_scene.h:77
std::string span
Definition records_scene.h:75
PlayerID player_id
Definition records_scene.h:73
std::string figure
Definition records_scene.h:76
One formatted record.
Definition records_scene.h:62
PlayerID player_id
Definition records_scene.h:67
std::string title
Definition records_scene.h:63
std::string when
Definition records_scene.h:66
std::string holder
Definition records_scene.h:65
std::string value
Definition records_scene.h:64
One formatted all-time table row.
Definition records_scene.h:82
uint32_t played
Definition records_scene.h:85
uint32_t drawn
Definition records_scene.h:87
uint32_t goals_against
Definition records_scene.h:90
uint32_t goals_for
Definition records_scene.h:89
uint32_t points
Definition records_scene.h:91
std::string club
Definition records_scene.h:84
uint32_t won
Definition records_scene.h:86
uint32_t lost
Definition records_scene.h:88
TeamID team_id
Definition records_scene.h:83
uint8_t LeagueID
Type alias for League identifiers.
Definition types.h:15
uint16_t TeamID
Type alias for Team identifiers.
Definition types.h:18
uint32_t PlayerID
Type alias for Player identifiers.
Definition types.h:21