Player12
An open source football management simulator
Loading...
Searching...
No Matches
match_report_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 <optional>
12#include <string>
13#include <vector>
14
17#include "model/match_report.h"
18
25{
26 public:
28 TeamID awayId);
29
30 void update(float deltaTime) override;
31 [[nodiscard]] SceneID getID() const override { return SceneID::MATCH_REPORT; }
32 [[nodiscard]] std::optional<NavEntry> historyEntry() const override
33 {
35 }
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 EventRow
49 {
50 std::string minute;
51 std::string text;
52 std::string assist;
54 bool home;
55 };
56
57 static void eventText(const EventRow& event, bool alignRight);
58
59 struct PlayerRow
60 {
61 PlayerID id = 0;
62 std::string name;
64 };
65
66 void renderScore();
67 void renderEvents(float width, float height) const;
68 void renderStats(float width, float height);
69 void renderRatings(const char* id, const std::string& club,
70 const std::vector<PlayerRow>& rows, float width,
71 float height);
72
76 std::optional<MatchReport> report;
77 std::string home_name;
78 std::string away_name;
79 std::string result_note;
80 std::vector<EventRow> events;
81 std::vector<PlayerRow> home_players;
82 std::vector<PlayerRow> away_players;
84 int tab = 0;
85};
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
The Analysis tab of the match report: a written summary, the xG race with final-third pressure,...
Definition match_insights_view.h:31
Post-match report: score, goal and card timeline, team statistics and player ratings for one played f...
Definition match_report_scene.h:25
GameDateValue date
Definition match_report_scene.h:73
void update(float deltaTime) override
Updates scene logic.
Definition match_report_scene.cpp:135
MatchInsightsView insights
Definition match_report_scene.h:83
std::vector< EventRow > events
Definition match_report_scene.h:80
int tab
Definition match_report_scene.h:84
NavSection navSection() const override
Sidebar entry highlighted for this screen.
Definition match_report_scene.h:39
void renderRatings(const char *id, const std::string &club, const std::vector< PlayerRow > &rows, float width, float height)
Definition match_report_scene.cpp:477
std::string away_name
Definition match_report_scene.h:78
std::string result_note
Definition match_report_scene.h:79
std::optional< MatchReport > report
Definition match_report_scene.h:76
TeamID away_id
Definition match_report_scene.h:75
void renderScore()
Definition match_report_scene.cpp:263
void renderStats(float width, float height)
Definition match_report_scene.cpp:428
static void eventText(const EventRow &event, bool alignRight)
Definition match_report_scene.cpp:372
std::optional< NavEntry > historyEntry() const override
Definition match_report_scene.h:32
void refresh() override
Rebuilds cached view models from the game state.
Definition match_report_scene.cpp:140
void renderContent() override
Draws the page body inside the content region.
Definition match_report_scene.cpp:206
std::vector< PlayerRow > home_players
Definition match_report_scene.h:81
SceneID getID() const override
Gets the ID of the scene.
Definition match_report_scene.h:31
std::string home_name
Definition match_report_scene.h:77
std::vector< PlayerRow > away_players
Definition match_report_scene.h:82
TeamID home_id
Definition match_report_scene.h:74
void renderEvents(float width, float height) const
Definition match_report_scene.cpp:389
friend class GameFlowTest_GUIFlowLifecycle_Test
Definition match_report_scene.h:46
SceneID
Identifiers for different GUI scenes.
Definition gui_scene.h:24
@ MATCH_REPORT
MatchEventKind
Kind of a structured, persisted match event.
Definition match_report.h:24
NavSection
Screens of the management shell. The sidebar groups them into a few hubs (Home, Inbox,...
Definition nav_history.h:26
Represents a specific date in the game world.
Definition gamedate.h:20
Definition match_report_scene.h:49
std::string minute
Definition match_report_scene.h:50
bool home
Definition match_report_scene.h:54
std::string text
Definition match_report_scene.h:51
std::string assist
Definition match_report_scene.h:52
MatchEventKind kind
Definition match_report_scene.h:53
Definition match_report_scene.h:60
std::string name
Definition match_report_scene.h:62
PlayerMatchLine line
Definition match_report_scene.h:63
static NavEntry ofMatchReport(GameDateValue date, TeamID home, TeamID away)
Definition nav_history.cpp:36
Per-player line of a finished match.
Definition match_report.h:73
uint16_t TeamID
Type alias for Team identifiers.
Definition types.h:18
uint32_t PlayerID
Type alias for Player identifiers.
Definition types.h:21