Player12
An open source football management simulator
Loading...
Searching...
No Matches
reserves_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
17#include "gui/widgets/widgets.h"
18
27{
28 public:
29 explicit ReservesScene(GUIView* parent);
30
31 void update(float deltaTime) override;
32 [[nodiscard]] SceneID getID() const override { return SceneID::RESERVES; }
33
34 protected:
35 void renderContent() override;
36 [[nodiscard]] NavSection navSection() const override
37 {
39 }
40 void refresh() override;
41
42 private:
44
45 enum class Tab : uint8_t
46 {
47 SQUAD,
48 LEAGUE,
50 };
51
52 enum class ListKind : uint8_t
53 {
54 SQUAD,
56 };
57
59 struct Row
60 {
62 std::string role;
63 std::string ability;
64 std::string potential;
65 std::string contract;
66 std::string rating;
67 std::string origin;
68 std::string terms;
69 bool overage = false;
70 };
71
72 struct TableLine
73 {
74 int position = 0;
75 std::string club;
76 std::string record;
77 std::string goals;
78 int points = 0;
79 bool own = false;
80 };
81
83 {
84 std::string date;
85 std::string opponent;
86 std::string score;
88 };
89
91 {
92 enum class Kind : uint8_t
93 {
94 NONE,
95 PROMOTE,
96 TO_U18,
97 TO_U21,
99 };
101 PlayerID id = 0;
102 };
103
104 void renderSquad();
105 void renderLeague();
106 void renderCandidates();
107 void renderQuotaCard(float width) const;
108 void renderResultsCard(float width);
109 void renderTable(const char* id, const std::vector<Row>& rows, ListKind kind);
110 void renderDetail(const Row& row, ListKind kind);
111 void runPending();
113 void openTab(Tab tab);
114
116 std::vector<Row> squad_rows;
117 std::vector<Row> candidate_rows;
118 std::vector<TableLine> table;
119 std::vector<ResultLine> results;
120 std::vector<UI::Outcome> form;
121 std::string subtitle;
122 std::string squad_title;
123 std::string league_title;
124 std::string league_line;
125 std::string quota_outfield;
126 std::string quota_keepers;
127 std::string squad_size;
131 bool tab_pending = false;
133};
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
Under-21 squad: the U21 players with their minutes and contracts (Squad), the country's U21 league wi...
Definition reserves_scene.h:27
void openTab(Tab tab)
Definition reserves_scene.cpp:265
GameController::ReserveOverview overview
Definition reserves_scene.h:115
void refresh() override
Rebuilds cached view models from the game state.
Definition reserves_scene.cpp:121
std::vector< UI::Outcome > form
Definition reserves_scene.h:120
void renderLeague()
Definition reserves_scene.cpp:301
GameDateValue cached_date
Definition reserves_scene.h:128
void update(float deltaTime) override
Updates scene logic.
Definition reserves_scene.cpp:93
PendingAction pending
Definition reserves_scene.h:132
std::string squad_size
Definition reserves_scene.h:127
std::string quota_outfield
Definition reserves_scene.h:125
void renderResultsCard(float width)
Definition reserves_scene.cpp:355
ListKind
Definition reserves_scene.h:53
std::vector< Row > squad_rows
Definition reserves_scene.h:116
Tab
Definition reserves_scene.h:46
std::string league_title
Definition reserves_scene.h:123
std::string quota_keepers
Definition reserves_scene.h:126
std::vector< TableLine > table
Definition reserves_scene.h:118
void renderSquad()
Definition reserves_scene.cpp:272
PlayerID selected
Definition reserves_scene.h:129
void renderTable(const char *id, const std::vector< Row > &rows, ListKind kind)
Definition reserves_scene.cpp:390
void renderQuotaCard(float width) const
Definition reserves_scene.cpp:380
bool tab_pending
Definition reserves_scene.h:131
void renderCandidates()
Definition reserves_scene.cpp:286
void renderDetail(const Row &row, ListKind kind)
Definition reserves_scene.cpp:502
std::string squad_title
Definition reserves_scene.h:122
SceneID getID() const override
Gets the ID of the scene.
Definition reserves_scene.h:32
void runPending()
Definition reserves_scene.cpp:556
std::vector< Row > candidate_rows
Definition reserves_scene.h:117
std::vector< ResultLine > results
Definition reserves_scene.h:119
NavSection navSection() const override
Sidebar entry highlighted for this screen.
Definition reserves_scene.h:36
std::string subtitle
Definition reserves_scene.h:121
Tab requested_tab
Definition reserves_scene.h:130
Row makeRow(const GameController::YouthPlayerView &view) const
Definition reserves_scene.cpp:98
std::string league_line
Definition reserves_scene.h:124
friend class GameFlowTest_GUIFlowLifecycle_Test
Definition reserves_scene.h:43
void renderContent() override
Draws the page body inside the content region.
Definition reserves_scene.cpp:204
SceneID
Identifiers for different GUI scenes.
Definition gui_scene.h:24
Outcome
Match outcome for form strips.
Definition widgets.h:87
NavSection
Screens of the management shell. The sidebar groups them into a few hubs (Home, Inbox,...
Definition nav_history.h:26
Definition game_controller.h:1110
Definition game_controller.h:1036
Represents a specific date in the game world.
Definition gamedate.h:20
Definition reserves_scene.h:91
Kind kind
Definition reserves_scene.h:100
Kind
Definition reserves_scene.h:93
Definition reserves_scene.h:83
std::string date
Definition reserves_scene.h:84
std::string score
Definition reserves_scene.h:86
std::string opponent
Definition reserves_scene.h:85
UI::Outcome outcome
Definition reserves_scene.h:87
One player line, pre-formatted at refresh time.
Definition reserves_scene.h:60
std::string contract
Definition reserves_scene.h:65
std::string terms
Definition reserves_scene.h:68
std::string potential
Definition reserves_scene.h:64
GameController::YouthPlayerView view
Definition reserves_scene.h:61
std::string role
Definition reserves_scene.h:62
std::string rating
Definition reserves_scene.h:66
bool overage
Definition reserves_scene.h:69
std::string ability
Definition reserves_scene.h:63
std::string origin
Definition reserves_scene.h:67
Definition reserves_scene.h:73
std::string club
Definition reserves_scene.h:75
std::string record
Definition reserves_scene.h:76
int points
Definition reserves_scene.h:78
int position
Definition reserves_scene.h:74
std::string goals
Definition reserves_scene.h:77
bool own
Definition reserves_scene.h:79
uint32_t PlayerID
Type alias for Player identifiers.
Definition types.h:21