Player12
An open source football management simulator
Loading...
Searching...
No Matches
standings_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
18#include "model/competition.h"
20
26{
27 public:
28 explicit StandingsScene(GUIView* parent);
29
30 void update(float deltaTime) override;
31 [[nodiscard]] SceneID getID() const override { return SceneID::STANDINGS; }
32
33 protected:
34 void renderContent() override;
35 [[nodiscard]] NavSection navSection() const override
36 {
38 }
39 void refresh() override;
40
41 private:
45 struct ScorerRow
46 {
47 PlayerID id = 0;
48 std::string name;
49 std::string club;
50 uint16_t goals = 0;
51 uint16_t assists = 0;
52 };
53
56 void renderHighlights();
57 void renderTable(float width, float height);
58 void renderStandingRow(size_t index, UI::ColumnMask mask, TeamID clubId,
59 size_t continental) const;
60 void renderScorers(float width, float height);
61 void renderCup();
62 void renderCupSummary(TeamID clubId) const;
63 void renderCupDraw(TeamID clubId);
64 void renderCupTie(const Match& match, size_t id, TeamID clubId) const;
65 void renderCupBracketRows(TeamID clubId) const;
67 void refreshRace();
68 void renderNeeds() const;
70 void refreshPastSeason(uint16_t season);
71 [[nodiscard]] std::string seasonLabel(uint16_t season) const;
72
74 bool league_chosen = false;
75 bool showing_cup = false;
77 std::vector<CompetitionView::StandingRow> table;
82 std::vector<Standings::Clinch> clinch;
84 std::vector<std::string> need_lines;
86 UI::ColumnMask table_mask = ~UI::ColumnMask{0};
87 std::vector<ScorerRow> scorers;
88 std::optional<Competitions::CupStatus> cup;
89 std::vector<std::pair<LeagueID, std::string>> cup_names;
91 std::vector<uint16_t> past_seasons;
93 std::optional<uint16_t> past_season;
96};
Modal that reveals a draw already made, one tie at a time.
Definition draw_ceremony_dialog.h:32
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
Represents a football match between two teams.
Definition match.h:38
Competitions: the full table of any league (form, promotion and relegation zones, top scorers) or the...
Definition standings_scene.h:26
std::vector< std::string > need_lines
Definition standings_scene.h:84
void renderCompetitionSelector()
Definition standings_scene.cpp:431
void renderNeeds() const
Definition standings_scene.cpp:346
void renderCupDraw(TeamID clubId)
Definition standings_scene.cpp:797
void refreshRace()
Definition standings_scene.cpp:293
bool league_chosen
Definition standings_scene.h:74
Standings::RacePlaces places
Definition standings_scene.h:80
std::vector< ScorerRow > scorers
Definition standings_scene.h:87
LeagueID cup_id
Definition standings_scene.h:76
void renderCupSummary(TeamID clubId) const
Definition standings_scene.cpp:770
std::vector< Standings::Clinch > clinch
Definition standings_scene.h:82
LeagueID league_id
Definition standings_scene.h:73
std::optional< Competitions::CupStatus > cup
Definition standings_scene.h:88
UI::ColumnMask table_mask
Definition standings_scene.h:86
void refresh() override
Rebuilds cached view models from the game state.
Definition standings_scene.cpp:204
void renderScorers(float width, float height)
Definition standings_scene.cpp:680
std::vector< uint16_t > past_seasons
Definition standings_scene.h:91
void renderContent() override
Draws the page body inside the content region.
Definition standings_scene.cpp:366
void renderCup()
Definition standings_scene.cpp:856
void renderTable(float width, float height)
Definition standings_scene.cpp:607
void renderHighlights()
Definition standings_scene.cpp:529
void renderStandingRow(size_t index, UI::ColumnMask mask, TeamID clubId, size_t continental) const
Definition standings_scene.cpp:636
void update(float deltaTime) override
Updates scene logic.
Definition standings_scene.cpp:199
void renderCupBracketRows(TeamID clubId) const
Definition standings_scene.cpp:839
friend class GameFlowTest_ManagementScreensMidSeason_Test
Definition standings_scene.h:43
NavSection navSection() const override
Sidebar entry highlighted for this screen.
Definition standings_scene.h:35
std::vector< CompetitionView::StandingRow > table
Definition standings_scene.h:77
std::string seasonLabel(uint16_t season) const
Definition standings_scene.cpp:360
void renderCupTie(const Match &match, size_t id, TeamID clubId) const
Definition standings_scene.cpp:819
std::vector< std::pair< LeagueID, std::string > > cup_names
Definition standings_scene.h:89
CompetitionView::Zones zones
Definition standings_scene.h:78
std::optional< uint16_t > past_season
Definition standings_scene.h:93
void refreshPastSeason(uint16_t season)
Definition standings_scene.cpp:255
void renderSeasonSelector()
Definition standings_scene.cpp:478
friend class GameFlowTest_GUIFlowLifecycle_Test
Definition standings_scene.h:42
bool showing_cup
Definition standings_scene.h:75
DrawCeremonyDialog draw_dialog
Definition standings_scene.h:95
SceneID getID() const override
Gets the ID of the scene.
Definition standings_scene.h:31
SceneID
Identifiers for different GUI scenes.
Definition gui_scene.h:24
Small vector icons drawn with ImDrawList (no icon font needed).
Definition icons.cpp:33
uint32_t ColumnMask
Visible-column mask produced by fitColumns().
Definition widgets.h:353
NavSection
Screens of the management shell. The sidebar groups them into a few hubs (Home, Inbox,...
Definition nav_history.h:26
int index
Definition runtime_editor.cpp:94
Number of promotion and relegation places in a league table.
Definition competition_view.h:70
One formatted top-scorer line.
Definition standings_scene.h:46
uint16_t assists
Definition standings_scene.h:51
std::string name
Definition standings_scene.h:48
std::string club
Definition standings_scene.h:49
uint16_t goals
Definition standings_scene.h:50
Table places that decide something. Promotion, play-off and continental places count from the top (pl...
Definition standings_race.h:62
uint8_t LeagueID
Type alias for League identifiers.
Definition types.h:15
uint16_t TeamID
Type alias for Team identifiers.
Definition types.h:18
uint32_t PlayerID
Type alias for Player identifiers.
Definition types.h:21