Player12
An open source football management simulator
Loading...
Searching...
No Matches
data_hub_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 <string>
13#include <vector>
14
17
27{
28 public:
29 explicit DataHubScene(GUIView* parent);
30
31 void update(float /*deltaTime*/) override
32 {
33 // Rendering reads current state; there is no per-frame update work.
34 }
35 [[nodiscard]] SceneID getID() const override { return SceneID::DATA_HUB; }
36
37 protected:
38 void renderContent() override;
39 [[nodiscard]] NavSection navSection() const override
40 {
42 }
43 void refresh() override;
44
45 private:
47
48 struct PlayerRow
49 {
50 PlayerID id = 0;
51 std::string name;
52 std::string role;
54 };
55
56 void renderTeam();
57 void renderPlayers();
58 void renderTrendChart(float width);
59 void renderShotMap(float width);
60 void renderSetPieces(float width);
61 void renderComparison(float width);
62 void renderPerformance(float width);
63 void renderLeaders(float width);
64
66 struct LeaderRow
67 {
68 PlayerID id = 0;
69 std::string name;
70 std::string short_name;
71 std::string value;
72 std::string tooltip;
73 };
74
76 std::vector<PlayerRow> players;
77 std::vector<std::string> opponent_names;
78 std::vector<std::string> performance_tooltips;
79 float performance_top = 0.5f;
80 std::array<std::vector<LeaderRow>, LEADER_METRIC_COUNT> leaders;
81 std::string leaders_note;
82 int tab = 0;
83 int shot_side = 0;
84};
Data hub: the managed club's season in numbers. Team tab: xG trend, finishing and goalkeeping against...
Definition data_hub_scene.h:27
float performance_top
Definition data_hub_scene.h:79
void update(float) override
Updates scene logic.
Definition data_hub_scene.h:31
int tab
Definition data_hub_scene.h:82
void renderShotMap(float width)
Definition data_hub_scene.cpp:573
std::array< std::vector< LeaderRow >, LEADER_METRIC_COUNT > leaders
Definition data_hub_scene.h:80
std::vector< PlayerRow > players
Definition data_hub_scene.h:76
void renderPerformance(float width)
Definition data_hub_scene.cpp:283
int shot_side
Definition data_hub_scene.h:83
void renderTrendChart(float width)
Definition data_hub_scene.cpp:449
void renderTeam()
Definition data_hub_scene.cpp:215
std::vector< std::string > performance_tooltips
Definition data_hub_scene.h:78
GameController::DataHubView hub
Definition data_hub_scene.h:75
void renderComparison(float width)
Definition data_hub_scene.cpp:689
NavSection navSection() const override
Sidebar entry highlighted for this screen.
Definition data_hub_scene.h:39
void renderPlayers()
Definition data_hub_scene.cpp:745
void renderSetPieces(float width)
Definition data_hub_scene.cpp:656
void renderContent() override
Draws the page body inside the content region.
Definition data_hub_scene.cpp:199
std::vector< std::string > opponent_names
Definition data_hub_scene.h:77
std::string leaders_note
Definition data_hub_scene.h:81
void refresh() override
Rebuilds cached view models from the game state.
Definition data_hub_scene.cpp:122
SceneID getID() const override
Gets the ID of the scene.
Definition data_hub_scene.h:35
void renderLeaders(float width)
Definition data_hub_scene.cpp:378
friend class GameFlowTest_GUIFlowLifecycle_Test
Definition data_hub_scene.h:46
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
constexpr std::size_t LEADER_METRIC_COUNT
Definition data_hub.h:233
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
Definition data_hub_scene.h:67
std::string short_name
Definition data_hub_scene.h:70
std::string tooltip
Definition data_hub_scene.h:72
std::string value
Definition data_hub_scene.h:71
std::string name
Definition data_hub_scene.h:69
Definition data_hub_scene.h:49
std::string role
Definition data_hub_scene.h:52
PlayerAnalyticsRow stats
Definition data_hub_scene.h:53
std::string name
Definition data_hub_scene.h:51
Definition game_controller.h:1313
One player of the analysed club.
Definition data_hub.h:164
uint32_t PlayerID
Type alias for Player identifiers.
Definition types.h:21