Player12
An open source football management simulator
Loading...
Searching...
No Matches
player_profile_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 <optional>
13#include <string>
14#include <vector>
15
20#include "model/player.h"
22
35{
36 public:
37 PlayerProfileScene(GUIView* parent, PlayerID playerId);
38
39 void update(float deltaTime) override;
40 [[nodiscard]] SceneID getID() const override
41 {
43 }
44 [[nodiscard]] std::optional<NavEntry> historyEntry() const override
45 {
47 }
48
49 protected:
50 void renderContent() override;
51 [[nodiscard]] NavSection navSection() const override;
52 void refresh() override;
53
54 private:
57
60 {
61 std::string name;
62 float value = 0.0f;
63 float low = 0.0f;
64 float high = 0.0f;
65 };
66
68 {
69 const char* title_key;
70 std::vector<AttributeLine> lines;
71 };
72
74 struct StatsRow
75 {
76 std::string label;
78 };
79
82 {
83 std::string date;
84 std::string from;
85 std::string to;
86 const char* kind_key = "";
87 std::string fee;
88 };
89
92 {
93 std::string heading;
94 char grade = 'C';
95 const char* grade_key = "";
96 std::string ability;
97 std::string potential;
98 std::string fee;
99 };
100
101 void renderHeader();
102 void renderActions();
103 void renderBio(const Player& player, float width, float height) const;
104 void renderStatus(float width, float height) const;
105 void renderAttributes(float width, float height) const;
106 void renderSuitability(float width, float height) const;
107 void renderScouting(float width, float height);
108 void renderStatistics(float width, float height);
109 void renderStatsTable(const std::vector<StatsRow>& rows, bool career) const;
110 void renderTransfers() const;
111 void renderDialogs();
112 void sendScout();
113 [[nodiscard]] const Player* player() const;
114 [[nodiscard]] bool isOwnPlayer() const;
115
118 std::string club_name;
119 std::string nationality;
120 std::string clause_text;
121 std::vector<PlayerView::RoleFit> fits;
122 std::vector<AttributeSection> sections;
123 std::vector<StatsRow> season_rows;
124 std::vector<StatsRow> career_rows;
125 std::vector<TransferLine> transfers;
126
127 // Fitness, availability and outlook, cached on refresh.
129 float form = 0.0f;
130 uint8_t league_ban = 0;
131 uint8_t cup_ban = 0;
132 const char* squad_role_key = nullptr;
133 float potential_low = 0.0f;
134 float potential_high = 0.0f;
135
136 // Scouting view of another club's player.
137 bool scouted = false;
138 uint8_t knowledge = 0;
139 std::string overall_range;
140 std::optional<ReportSummary> latest_report;
141 bool shortlisted = false;
142 bool being_scouted = false;
143 int64_t scout_cost = 0;
144 bool window_open = false;
145
147 bool renew_requested = false;
150};
Modal contract talks with a player and his agent: a transfer target whose fee is agreed,...
Definition contract_talks_dialog.h:37
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
Full profile of one player: bio and contract, fitness and form, attributes grouped by category,...
Definition player_profile_scene.h:35
void sendScout()
Definition player_profile_scene.cpp:612
void refresh() override
Rebuilds cached view models from the game state.
Definition player_profile_scene.cpp:180
PlayerTalkDialog talk_dialog
Definition player_profile_scene.h:149
bool shortlisted
Definition player_profile_scene.h:141
std::vector< StatsRow > career_rows
Definition player_profile_scene.h:124
bool being_scouted
Definition player_profile_scene.h:142
void renderStatus(float width, float height) const
Definition player_profile_scene.cpp:682
void renderStatsTable(const std::vector< StatsRow > &rows, bool career) const
Definition player_profile_scene.cpp:893
bool renew_requested
Definition player_profile_scene.h:147
void renderStatistics(float width, float height)
Definition player_profile_scene.cpp:865
void renderContent() override
Draws the page body inside the content region.
Definition player_profile_scene.cpp:350
void renderSuitability(float width, float height) const
Definition player_profile_scene.cpp:799
uint8_t cup_ban
Definition player_profile_scene.h:131
void update(float deltaTime) override
Updates scene logic.
Definition player_profile_scene.cpp:155
const char * squad_role_key
Definition player_profile_scene.h:132
bool scouted
Definition player_profile_scene.h:137
const Player * player() const
Definition player_profile_scene.cpp:166
void renderTransfers() const
Definition player_profile_scene.cpp:948
NavSection navSection() const override
Sidebar entry highlighted for this screen.
Definition player_profile_scene.cpp:161
int64_t scout_cost
Definition player_profile_scene.h:143
float potential_low
Definition player_profile_scene.h:133
std::vector< PlayerView::RoleFit > fits
Definition player_profile_scene.h:121
ContractTalksDialog contract_talks
Definition player_profile_scene.h:148
std::string overall_range
Definition player_profile_scene.h:139
void renderHeader()
Definition player_profile_scene.cpp:402
void renderActions()
Definition player_profile_scene.cpp:502
bool isOwnPlayer() const
Definition player_profile_scene.cpp:174
void renderDialogs()
Definition player_profile_scene.cpp:987
uint8_t knowledge
Definition player_profile_scene.h:138
std::vector< AttributeSection > sections
Definition player_profile_scene.h:122
float form
Definition player_profile_scene.h:129
std::vector< StatsRow > season_rows
Definition player_profile_scene.h:123
std::vector< TransferLine > transfers
Definition player_profile_scene.h:125
uint8_t league_ban
Definition player_profile_scene.h:130
PlayerDynamics dynamics
Definition player_profile_scene.h:128
bool window_open
Definition player_profile_scene.h:144
void renderAttributes(float width, float height) const
Definition player_profile_scene.cpp:760
SceneID getID() const override
Gets the ID of the scene.
Definition player_profile_scene.h:40
friend class GameFlowTest_ManagementScreensMidSeason_Test
Definition player_profile_scene.h:56
void renderScouting(float width, float height)
Definition player_profile_scene.cpp:816
void renderBio(const Player &player, float width, float height) const
Definition player_profile_scene.cpp:641
std::optional< NavEntry > historyEntry() const override
Definition player_profile_scene.h:44
std::optional< ReportSummary > latest_report
Definition player_profile_scene.h:140
std::string nationality
Definition player_profile_scene.h:119
std::string club_name
Definition player_profile_scene.h:118
float potential_high
Definition player_profile_scene.h:134
bool list_confirm_requested
Definition player_profile_scene.h:146
PlayerID player_id
Definition player_profile_scene.h:116
friend class GameFlowTest_GUIFlowLifecycle_Test
Definition player_profile_scene.h:55
std::string clause_text
Definition player_profile_scene.h:120
PlayerView::PlayerRow row
Definition player_profile_scene.h:117
Modal one-to-one conversation with a managed player.
Definition player_talk_dialog.h:36
Persistent career identity, attributes, traits and day-to-day state.
Definition player.h:104
SceneID
Identifiers for different GUI scenes.
Definition gui_scene.h:24
@ PLAYER_PROFILE
NavSection
Screens of the management shell. The sidebar groups them into a few hubs (Home, Inbox,...
Definition nav_history.h:26
static NavEntry ofPlayer(PlayerID player)
Definition nav_history.cpp:20
Day-to-day state that changes between matches.
Definition player.h:72
An attribute; low == high == value when known exactly.
Definition player_profile_scene.h:60
float high
Definition player_profile_scene.h:64
std::string name
Definition player_profile_scene.h:61
float low
Definition player_profile_scene.h:63
float value
Definition player_profile_scene.h:62
Definition player_profile_scene.h:68
const char * title_key
Definition player_profile_scene.h:69
std::vector< AttributeLine > lines
Definition player_profile_scene.h:70
The latest scout report, formatted for display.
Definition player_profile_scene.h:92
std::string ability
Definition player_profile_scene.h:96
const char * grade_key
Definition player_profile_scene.h:95
std::string potential
Definition player_profile_scene.h:97
char grade
Definition player_profile_scene.h:94
std::string heading
Definition player_profile_scene.h:93
std::string fee
Definition player_profile_scene.h:98
One statistics row (a competition this season, or a season).
Definition player_profile_scene.h:75
std::string label
Definition player_profile_scene.h:76
PlayerSeasonStats stats
Definition player_profile_scene.h:77
One move in the player's transfer history.
Definition player_profile_scene.h:82
std::string to
Definition player_profile_scene.h:85
std::string fee
Definition player_profile_scene.h:87
const char * kind_key
Definition player_profile_scene.h:86
std::string from
Definition player_profile_scene.h:84
std::string date
Definition player_profile_scene.h:83
Competitive (league or cup) totals of a player for one team in one season. Friendlies are not counted...
Definition season_history.h:54
One table row.
Definition player_view.h:43
uint32_t PlayerID
Type alias for Player identifiers.
Definition types.h:21