Player12
An open source football management simulator
Loading...
Searching...
No Matches
StandingsScene Class Reference

Competitions: the full table of any league (form, promotion and relegation zones, top scorers) or the draw of any national cup. More...

#include <standings_scene.h>

Inheritance diagram for StandingsScene:
ManagementScene GUIScene

Classes

struct  ScorerRow
 One formatted top-scorer line. More...
 

Public Member Functions

 StandingsScene (GUIView *parent)
 
void update (float deltaTime) override
 Updates scene logic.
 
SceneID getID () const override
 Gets the ID of the scene.
 
- Public Member Functions inherited from ManagementScene
 ManagementScene (GUIView *guiViewPtr)
 
void render () final
 Renders the scene.
 
void onEnter () override
 Called when the scene is entered/becomes active.
 
void onResume () override
 Called when an overlay above this scene closes and it becomes the active scene again. Screens use it to refresh cached view models after a match, a transfer or any other state change made elsewhere.
 
void handleEvent (const SDL_Event &event) override
 
std::optional< NavEntry > historyEntry () const override
 
- Public Member Functions inherited from GUIScene
 GUIScene (GUIView *guiView_ptr)
 Constructs a new GUIScene.
 
virtual ~GUIScene ()=default
 Destroys the GUIScene.
 
virtual void onExit ()
 Called when the scene is exited/becomes inactive.
 
virtual void onResize (int width, int height)
 Called when the window is resized.
 

Protected Member Functions

void renderContent () override
 Draws the page body inside the content region.
 
NavSection navSection () const override
 Sidebar entry highlighted for this screen.
 
void refresh () override
 Rebuilds cached view models from the game state.
 
- Protected Member Functions inherited from ManagementScene
virtual std::optional< EditorContext > editorContext () const
 
void showToast (std::string message, bool isError=false)
 Shows a short confirmation message in the top bar.
 
HolidayDialog & holidayDialog ()
 Holiday planner and return report of this screen.
 
- Protected Member Functions inherited from GUIScene
SDL_Renderer * getRenderer () const
 Gets the SDL renderer.
 
SDL_Window * getWindow () const
 Gets the SDL window.
 
GUIView * getGuiView () const
 Gets the associated GUIView.
 
void changeScene (std::unique_ptr< GUIScene > newScene)
 Requests a scene change.
 
void quit ()
 Requests the application to quit.
 

Private Member Functions

void renderCompetitionSelector ()
 
void renderSeasonSelector ()
 
void renderHighlights ()
 
void renderTable (float width, float height)
 
void renderStandingRow (size_t index, UI::ColumnMask mask, TeamID clubId, size_t continental) const
 
void renderScorers (float width, float height)
 
void renderCup ()
 
void renderCupSummary (TeamID clubId) const
 
void renderCupDraw (TeamID clubId)
 
void renderCupTie (const Match &match, size_t id, TeamID clubId) const
 
void renderCupBracketRows (TeamID clubId) const
 
void refreshRace ()
 
void renderNeeds () const
 
void refreshPastSeason (uint16_t season)
 
std::string seasonLabel (uint16_t season) const
 

Private Attributes

LeagueID league_id = 0
 
bool league_chosen = false
 
bool showing_cup = false
 
LeagueID cup_id = 0
 
std::vector< CompetitionView::StandingRow > table
 
CompetitionView::Zones zones
 
Standings::RacePlaces places
 
std::vector< Standings::Clinch > clinch
 
std::vector< std::string > need_lines
 
UI::ColumnMask table_mask = ~UI::ColumnMask{0}
 
std::vector< ScorerRow > scorers
 
std::optional< Competitions::CupStatus > cup
 
std::vector< std::pair< LeagueID, std::string > > cup_names
 
std::vector< uint16_t > past_seasons
 
std::optional< uint16_t > past_season
 
DrawCeremonyDialog draw_dialog
 

Friends

class GameFlowTest_GUIFlowLifecycle_Test
 
class GameFlowTest_ManagementScreensMidSeason_Test
 

Additional Inherited Members

- Protected Attributes inherited from GUIScene
GUIView * guiView
 

Detailed Description

Competitions: the full table of any league (form, promotion and relegation zones, top scorers) or the draw of any national cup.

Constructor & Destructor Documentation

◆ StandingsScene()

StandingsScene::StandingsScene ( GUIView *  parent)
explicit

Member Function Documentation

◆ getID()

SceneID StandingsScene::getID ( ) const
inlineoverridevirtual

Gets the ID of the scene.

Returns
The SceneID of this scene.

GUIView uses this identifier to apply match-specific event and scene behavior.

Implements GUIScene.

◆ navSection()

NavSection StandingsScene::navSection ( ) const
inlineoverrideprotectedvirtual

Sidebar entry highlighted for this screen.

Implements ManagementScene.

◆ refresh()

void StandingsScene::refresh ( )
overrideprotectedvirtual

Rebuilds cached view models from the game state.

Reimplemented from ManagementScene.

◆ refreshPastSeason()

void StandingsScene::refreshPastSeason ( uint16_t  season)
private

Loads an archived final table and its top scorer.

◆ refreshRace()

void StandingsScene::refreshRace ( )
private

Clinched and lost places of every club, and the managed club's run-in.

◆ renderCompetitionSelector()

void StandingsScene::renderCompetitionSelector ( )
private

◆ renderContent()

void StandingsScene::renderContent ( )
overrideprotectedvirtual

Draws the page body inside the content region.

Implements ManagementScene.

◆ renderCup()

void StandingsScene::renderCup ( )
private

◆ renderCupBracketRows()

void StandingsScene::renderCupBracketRows ( TeamID  clubId) const
private

◆ renderCupDraw()

void StandingsScene::renderCupDraw ( TeamID  clubId)
private

◆ renderCupSummary()

void StandingsScene::renderCupSummary ( TeamID  clubId) const
private

◆ renderCupTie()

void StandingsScene::renderCupTie ( const Match &  match,
size_t  id,
TeamID  clubId 
) const
private

◆ renderHighlights()

void StandingsScene::renderHighlights ( )
private

◆ renderNeeds()

void StandingsScene::renderNeeds ( ) const
private

◆ renderScorers()

void StandingsScene::renderScorers ( float  width,
float  height 
)
private

◆ renderSeasonSelector()

void StandingsScene::renderSeasonSelector ( )
private

◆ renderStandingRow()

void StandingsScene::renderStandingRow ( size_t  index,
UI::ColumnMask  mask,
TeamID  clubId,
size_t  continental 
) const
private

◆ renderTable()

void StandingsScene::renderTable ( float  width,
float  height 
)
private

◆ seasonLabel()

std::string StandingsScene::seasonLabel ( uint16_t  season) const
private

◆ update()

void StandingsScene::update ( float  deltaTime)
overridevirtual

Updates scene logic.

Parameters
deltaTimeThe time elapsed since the last update.

Implements GUIScene.

Friends And Related Symbol Documentation

◆ GameFlowTest_GUIFlowLifecycle_Test

friend class GameFlowTest_GUIFlowLifecycle_Test
friend

◆ GameFlowTest_ManagementScreensMidSeason_Test

friend class GameFlowTest_ManagementScreensMidSeason_Test
friend

Member Data Documentation

◆ clinch

std::vector<Standings::Clinch> StandingsScene::clinch
private

Mathematically decided status of each table row (current season).

◆ cup

std::optional<Competitions::CupStatus> StandingsScene::cup
private

◆ cup_id

LeagueID StandingsScene::cup_id = 0
private

◆ cup_names

std::vector<std::pair<LeagueID, std::string> > StandingsScene::cup_names
private

◆ draw_dialog

DrawCeremonyDialog StandingsScene::draw_dialog
private

Ceremony of the cup's latest draw.

◆ league_chosen

bool StandingsScene::league_chosen = false
private

◆ league_id

LeagueID StandingsScene::league_id = 0
private

◆ need_lines

std::vector<std::string> StandingsScene::need_lines
private

What the managed club needs from its own games, ready to show.

◆ past_season

std::optional<uint16_t> StandingsScene::past_season
private

The archived season shown (nullopt: the current table).

◆ past_seasons

std::vector<uint16_t> StandingsScene::past_seasons
private

Archived seasons of the shown league, newest first.

◆ places

Standings::RacePlaces StandingsScene::places
private

Deciding places of the shown league (continental places included).

◆ scorers

std::vector<ScorerRow> StandingsScene::scorers
private

◆ showing_cup

bool StandingsScene::showing_cup = false
private

◆ table

std::vector<CompetitionView::StandingRow> StandingsScene::table
private

◆ table_mask

UI::ColumnMask StandingsScene::table_mask = ~UI::ColumnMask{0}
private

Columns the table showed last frame (for the column picker).

◆ zones

CompetitionView::Zones StandingsScene::zones
private

The documentation for this class was generated from the following files: