Player12
An open source football management simulator
Loading...
Searching...
No Matches
preseason_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 <optional>
14#include <string>
15#include <utility>
16#include <vector>
17
20#include "model/board.h"
22#include "model/preseason.h"
23
29{
30 public:
31 explicit PreseasonScene(GUIView* parent);
32
33 void update(float /*deltaTime*/) override
34 {
35 // Pre-season planning is driven by explicit user actions and the calendar.
36 }
37 [[nodiscard]] SceneID getID() const override { return SceneID::PLANNING; }
38
39 protected:
40 void renderContent() override;
41 [[nodiscard]] NavSection navSection() const override
42 {
44 }
45 void refresh() override;
46
47 private:
49
52 {
54 std::string date;
55 std::string opponent;
56 std::string suggestion;
57 };
58
61 {
63 std::string name;
64 std::string level;
65 std::string quote;
66 std::optional<FacilityProject> running;
67 std::string status;
68 bool can_request = false;
69 };
70
71 void renderPreseason(float width);
72 void renderFriendlyEditor(const FriendlyLine& line);
73 void renderCamp();
74 void renderProjects(float width);
75 void renderMentoring(float width);
76 void loadOpponents();
77
78 std::vector<FriendlyLine> friendlies;
80 int level = static_cast<int>(std::to_underlying(OpponentLevel::Similar));
81 int region = 0;
82 int venue = 0;
83 bool tour = false;
84 std::vector<OpponentOption> opponents;
85 std::vector<std::string> opponent_labels;
87 int tour_fee_for = -1;
88 std::string tour_fee_text;
89 int camp_choice = 0;
90 std::array<CampQuote, 3> camp_quotes;
91 bool camp_open = false;
92 std::string camp_status;
93 std::string camp_suggestion;
94
95 std::vector<ProjectLine> projects;
96 std::vector<std::string> completed_projects;
97 int seats_choice = 1;
98 std::array<std::string, 3> seat_labels;
99 std::string project_message;
101
102 std::vector<std::string> mentoring_lines;
104};
FacilityProjectType
Facility project (values are persisted).
Definition board.h:175
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
Modal editor of the managed club's mentoring groups.
Definition mentoring_dialog.h:29
Club planning: the pre-season (friendlies, tour and training camp), facility projects funded by the b...
Definition preseason_scene.h:29
void renderProjects(float width)
Definition preseason_scene.cpp:453
bool camp_open
Definition preseason_scene.h:91
int level
Definition preseason_scene.h:80
void renderFriendlyEditor(const FriendlyLine &line)
Definition preseason_scene.cpp:329
int camp_choice
Definition preseason_scene.h:89
std::vector< std::string > completed_projects
Definition preseason_scene.h:96
void refresh() override
Rebuilds cached view models from the game state.
Definition preseason_scene.cpp:44
std::string tour_fee_text
Definition preseason_scene.h:88
int opponent_index
Definition preseason_scene.h:86
int region
Definition preseason_scene.h:81
std::vector< OpponentOption > opponents
Definition preseason_scene.h:84
std::vector< FriendlyLine > friendlies
Definition preseason_scene.h:78
bool project_message_error
Definition preseason_scene.h:100
std::array< CampQuote, 3 > camp_quotes
Definition preseason_scene.h:90
void loadOpponents()
Definition preseason_scene.cpp:192
std::vector< std::string > opponent_labels
Definition preseason_scene.h:85
int venue
Definition preseason_scene.h:82
void renderContent() override
Draws the page body inside the content region.
Definition preseason_scene.cpp:214
std::string camp_suggestion
Definition preseason_scene.h:93
void renderMentoring(float width)
Definition preseason_scene.cpp:534
SceneID getID() const override
Gets the ID of the scene.
Definition preseason_scene.h:37
int seats_choice
Definition preseason_scene.h:97
std::string project_message
Definition preseason_scene.h:99
void update(float) override
Updates scene logic.
Definition preseason_scene.h:33
std::vector< std::string > mentoring_lines
Definition preseason_scene.h:102
void renderCamp()
Definition preseason_scene.cpp:403
bool tour
Definition preseason_scene.h:83
std::string camp_status
Definition preseason_scene.h:92
void renderPreseason(float width)
Definition preseason_scene.cpp:244
NavSection navSection() const override
Sidebar entry highlighted for this screen.
Definition preseason_scene.h:41
std::vector< ProjectLine > projects
Definition preseason_scene.h:95
MentoringDialog mentoring_dialog
Definition preseason_scene.h:103
std::array< std::string, 3 > seat_labels
Definition preseason_scene.h:98
int tour_fee_for
Definition preseason_scene.h:87
friend class GameFlowTest_GUIFlowLifecycle_Test
Definition preseason_scene.h:48
int selected_friendly
Definition preseason_scene.h:79
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
A pre-season friendly of the managed club.
Definition preseason.h:45
One formatted friendly.
Definition preseason_scene.h:52
FriendlySlot slot
Definition preseason_scene.h:53
std::string suggestion
Definition preseason_scene.h:56
std::string opponent
Definition preseason_scene.h:55
std::string date
Definition preseason_scene.h:54
One project type with its quote and state.
Definition preseason_scene.h:61
std::string status
Definition preseason_scene.h:67
bool can_request
Definition preseason_scene.h:68
std::string level
Definition preseason_scene.h:64
std::string name
Definition preseason_scene.h:63
FacilityProjectType type
Definition preseason_scene.h:62
std::string quote
Definition preseason_scene.h:65
std::optional< FacilityProject > running
Definition preseason_scene.h:66