Player12
An open source football management simulator
Loading...
Searching...
No Matches
staff_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 <cstdint>
13#include <string>
14#include <vector>
15
17#include "model/staff.h"
18
25{
26 public:
27 explicit StaffScene(GUIView* parent);
28
29 void update(float deltaTime) override;
30 [[nodiscard]] SceneID getID() const override { return SceneID::STAFF; }
31
32 protected:
33 void renderContent() override;
34 [[nodiscard]] NavSection navSection() const override
35 {
36 return NavSection::STAFF;
37 }
38 void refresh() override;
39
40 private:
42
44 struct StaffRow
45 {
46 StaffID id = 0;
48 std::string name;
49 std::string attributes;
50 int age = 0;
51 int rating = 0;
52 std::string wage;
53 std::string demand;
55 std::string contract;
56 std::string extend_help;
57 std::string hire_label;
58 bool role_full = false;
59 };
60
63 {
64 const char* area_key = "";
65 float quality = 0.0f;
66 std::string holder;
67 };
68
69 void renderStaff(float width);
70 void renderImpact(float width) const;
71 void renderMarket();
72 void renderFilters();
74 void renderGroups(const char* id, const std::vector<StaffRow>& rows,
75 bool market);
76 void renderDetail(const StaffRow& row, bool market);
78 void rebuildMarket();
79 void showResult(int result, const char* success_key);
80
83 {
84 enum class Kind : uint8_t
85 {
86 NONE,
87 HIRE,
88 EXTEND,
90 };
92 StaffID id = 0;
93 uint8_t years = 0;
94 };
95
96 std::vector<StaffRow> staff_rows;
97 std::vector<StaffRow> market_rows;
98 std::vector<Responsibility> responsibilities;
100 int role_filter = -1;
101 int min_rating = 0;
102 int hire_years = 2;
105 std::string release_text;
106 bool release_requested = false;
108};
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
Backroom staff: current coaches, medics and scouts with ratings and responsibilities,...
Definition staff_scene.h:25
void renderMarket()
Definition staff_scene.cpp:587
void renderFilters()
Definition staff_scene.cpp:544
StaffID release_candidate
Definition staff_scene.h:104
std::vector< StaffRow > market_rows
Definition staff_scene.h:97
void renderStaff(float width)
Definition staff_scene.cpp:343
PendingAction pending
Definition staff_scene.h:107
int hire_years
Definition staff_scene.h:102
void renderDetail(const StaffRow &row, bool market)
Definition staff_scene.cpp:438
NavSection navSection() const override
Sidebar entry highlighted for this screen.
Definition staff_scene.h:34
void renderReleaseConfirm()
Definition staff_scene.cpp:599
void renderImpact(float width) const
Definition staff_scene.cpp:515
void update(float deltaTime) override
Updates scene logic.
Definition staff_scene.cpp:138
std::vector< StaffRow > staff_rows
Definition staff_scene.h:96
void refresh() override
Rebuilds cached view models from the game state.
Definition staff_scene.cpp:144
void renderGroups(const char *id, const std::vector< StaffRow > &rows, bool market)
Definition staff_scene.cpp:353
void showResult(int result, const char *success_key)
Definition staff_scene.cpp:251
int min_rating
Definition staff_scene.h:101
bool release_requested
Definition staff_scene.h:106
int role_filter
Definition staff_scene.h:100
void renderContent() override
Draws the page body inside the content region.
Definition staff_scene.cpp:265
std::vector< Responsibility > responsibilities
Definition staff_scene.h:98
std::string release_text
Definition staff_scene.h:105
SceneID getID() const override
Gets the ID of the scene.
Definition staff_scene.h:30
friend class GameFlowTest_GUIFlowLifecycle_Test
Definition staff_scene.h:41
void rebuildMarket()
Definition staff_scene.cpp:217
StaffEffects effects
Definition staff_scene.h:99
StaffID selected
Definition staff_scene.h:103
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
std::uint32_t StaffID
Type alias for staff identifiers.
Definition staff.h:30
StaffRole
Staff roles (values are persisted).
Definition staff.h:34
@ AssistantManager
What a club's staff does for the squad (all bounded).
Definition staff.h:105
A button press, executed once the tables are drawn.
Definition staff_scene.h:83
Kind
Definition staff_scene.h:85
Kind kind
Definition staff_scene.h:91
uint8_t years
Definition staff_scene.h:93
Who covers an area and how well.
Definition staff_scene.h:63
float quality
Definition staff_scene.h:65
const char * area_key
Definition staff_scene.h:64
std::string holder
Definition staff_scene.h:66
One staff line, pre-formatted.
Definition staff_scene.h:45
int contract_years
Definition staff_scene.h:54
std::string hire_label
Definition staff_scene.h:57
std::string attributes
Definition staff_scene.h:49
int rating
Definition staff_scene.h:51
int age
Definition staff_scene.h:50
bool role_full
Definition staff_scene.h:58
StaffRole role
Definition staff_scene.h:47
std::string wage
Definition staff_scene.h:52
std::string name
Definition staff_scene.h:48
std::string demand
Definition staff_scene.h:53
std::string contract
Definition staff_scene.h:55
std::string extend_help
Definition staff_scene.h:56