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

Records book: club records with the club's all-time scorers and appearance makers, league records, the all-time league table and the club's hall of fame. More...

#include <records_scene.h>

Inheritance diagram for RecordsScene:
ManagementScene GUIScene

Classes

struct  PlayerLine
 One formatted player total. More...
 
struct  RecordLine
 One formatted record. More...
 
struct  TableLine
 One formatted all-time table row. More...
 

Public Types

enum class  Tab : int { CLUB = 0 , LEAGUE , ALL_TIME , HALL_OF_FAME }
 Tabs of the records book. More...
 

Public Member Functions

 RecordsScene (GUIView *parent)
 
void update (float) override
 Updates scene logic.
 
SceneID getID () const override
 Gets the ID of the scene.
 
void showTab (Tab tab)
 Shows a tab (e.g. from another screen).
 
- 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 renderClubSelector ()
 
void renderLeagueSelector ()
 
void renderRecords (const char *id, const char *title, const std::vector< RecordLine > &lines, float width)
 
void renderPlayers (const char *id, const char *title, const std::vector< PlayerLine > &lines, float width)
 
void renderAllTime ()
 
void renderHallOfFame ()
 

Private Attributes

Tab active_tab = Tab::CLUB
 
TeamID club_id = 0
 
LeagueID league_id = 0
 
std::vector< RecordLine > club_records
 
std::vector< RecordLine > league_records
 
std::vector< PlayerLine > scorers
 
std::vector< PlayerLine > appearances
 
std::vector< PlayerLine > legends
 
std::vector< TableLine > all_time
 

Friends

class GameFlowTest_GUIFlowLifecycle_Test
 

Additional Inherited Members

- Protected Attributes inherited from GUIScene
GUIView * guiView
 

Detailed Description

Records book: club records with the club's all-time scorers and appearance makers, league records, the all-time league table and the club's hall of fame.

Member Enumeration Documentation

◆ Tab

enum class RecordsScene::Tab : int
strong

Tabs of the records book.

Enumerator
CLUB 
LEAGUE 
ALL_TIME 
HALL_OF_FAME 

Constructor & Destructor Documentation

◆ RecordsScene()

RecordsScene::RecordsScene ( GUIView *  parent)
explicit

Member Function Documentation

◆ getID()

SceneID RecordsScene::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 RecordsScene::navSection ( ) const
inlineoverrideprotectedvirtual

Sidebar entry highlighted for this screen.

Implements ManagementScene.

◆ refresh()

void RecordsScene::refresh ( )
overrideprotectedvirtual

Rebuilds cached view models from the game state.

Reimplemented from ManagementScene.

◆ renderAllTime()

void RecordsScene::renderAllTime ( )
private

◆ renderClubSelector()

void RecordsScene::renderClubSelector ( )
private

◆ renderContent()

void RecordsScene::renderContent ( )
overrideprotectedvirtual

Draws the page body inside the content region.

Implements ManagementScene.

◆ renderHallOfFame()

void RecordsScene::renderHallOfFame ( )
private

◆ renderLeagueSelector()

void RecordsScene::renderLeagueSelector ( )
private

◆ renderPlayers()

void RecordsScene::renderPlayers ( const char *  id,
const char *  title,
const std::vector< PlayerLine > &  lines,
float  width 
)
private

◆ renderRecords()

void RecordsScene::renderRecords ( const char *  id,
const char *  title,
const std::vector< RecordLine > &  lines,
float  width 
)
private

◆ showTab()

void RecordsScene::showTab ( Tab  tab)
inline

Shows a tab (e.g. from another screen).

◆ update()

void RecordsScene::update ( float  deltaTime)
inlineoverridevirtual

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

Member Data Documentation

◆ active_tab

Tab RecordsScene::active_tab = Tab::CLUB
private

◆ all_time

std::vector<TableLine> RecordsScene::all_time
private

◆ appearances

std::vector<PlayerLine> RecordsScene::appearances
private

◆ club_id

TeamID RecordsScene::club_id = 0
private

◆ club_records

std::vector<RecordLine> RecordsScene::club_records
private

◆ league_id

LeagueID RecordsScene::league_id = 0
private

◆ league_records

std::vector<RecordLine> RecordsScene::league_records
private

◆ legends

std::vector<PlayerLine> RecordsScene::legends
private

◆ scorers

std::vector<PlayerLine> RecordsScene::scorers
private

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