Player12
An open source football management simulator
Loading...
Searching...
No Matches
GUIScene Class Referenceabstract

Base class for all GUI scenes. More...

#include <gui_scene.h>

Inheritance diagram for GUIScene:
AboutScene HelpScene MainMenuScene ManagementScene MatchScene SettingsScene TeamSelectionScene AwardsScene CalendarScene CallUpScene ClubScene DataHubScene DelegationScene FixturesScene InboxScene InternationalScene LineupScene MainGameScene ManagerScene MatchReportScene MedicalScene NewsScene OppositionScene PlayerCompareScene PlayerProfileScene PreseasonScene RecordsScene ReservesScene RosterScene ScoutingScene SquadPlannerScene StaffScene StandingsScene StrategyScene TimelineScene TrainingScene TransferMarketScene YouthScene

Public Member Functions

 GUIScene (GUIView *guiView_ptr)
 Constructs a new GUIScene.
 
virtual ~GUIScene ()=default
 Destroys the GUIScene.
 
virtual void handleEvent (const SDL_Event &event)
 Handles SDL events for the scene.
 
virtual void update (float deltaTime)=0
 Updates scene logic.
 
virtual void render ()=0
 Renders the scene.
 
virtual void onEnter ()
 Called when the scene is entered/becomes active.
 
virtual void onExit ()
 Called when the scene is exited/becomes inactive.
 
virtual void onResume ()
 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.
 
virtual void onResize (int width, int height)
 Called when the window is resized.
 
virtual SceneID getID () const =0
 Gets the ID of the scene.
 
virtual std::optional< NavEntry > historyEntry () const
 How to open this screen again from the navigation history, or nothing for scenes outside it (menus, team selection, the live match).
 

Protected Member Functions

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.
 

Protected Attributes

GUIView * guiView
 

Detailed Description

Base class for all GUI scenes.

Constructor & Destructor Documentation

◆ GUIScene()

GUIScene::GUIScene ( GUIView *  guiView_ptr)
explicit

Constructs a new GUIScene.

Parameters
guiView_ptrPointer to the main GUIView.

◆ ~GUIScene()

virtual GUIScene::~GUIScene ( )
virtualdefault

Destroys the GUIScene.

Member Function Documentation

◆ changeScene()

void GUIScene::changeScene ( std::unique_ptr< GUIScene >  newScene)
protected

Requests a scene change.

Parameters
newSceneThe new scene to transition to.

◆ getGuiView()

GUIView * GUIScene::getGuiView ( ) const
inlineprotected

Gets the associated GUIView.

Returns
The GUIView pointer.

◆ getID()

◆ getRenderer()

SDL_Renderer * GUIScene::getRenderer ( ) const
protected

Gets the SDL renderer.

Returns
The SDL_Renderer pointer.

◆ getWindow()

SDL_Window * GUIScene::getWindow ( ) const
protected

Gets the SDL window.

Returns
The SDL_Window pointer.

◆ handleEvent()

void GUIScene::handleEvent ( const SDL_Event &  event)
virtual

Handles SDL events for the scene.

Parameters
eventThe SDL event to process.

Reimplemented in ManagementScene, and MatchScene.

◆ historyEntry()

virtual std::optional< NavEntry > GUIScene::historyEntry ( ) const
inlinevirtual

How to open this screen again from the navigation history, or nothing for scenes outside it (menus, team selection, the live match).

Reimplemented in ManagementScene, MatchReportScene, PlayerCompareScene, PlayerProfileScene, and RosterScene.

◆ onEnter()

void GUIScene::onEnter ( )
virtual

Called when the scene is entered/becomes active.

Reimplemented in AboutScene, HelpScene, MainGameScene, MainMenuScene, ManagementScene, MatchScene, SettingsScene, and TeamSelectionScene.

◆ onExit()

void GUIScene::onExit ( )
virtual

Called when the scene is exited/becomes inactive.

Reimplemented in MatchScene.

◆ onResize()

void GUIScene::onResize ( int  width,
int  height 
)
virtual

Called when the window is resized.

Parameters
widthThe new window width.
heightThe new window height.

◆ onResume()

void GUIScene::onResume ( )
virtual

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.

Reimplemented in ManagementScene, and TransferMarketScene.

◆ quit()

void GUIScene::quit ( )
protected

Requests the application to quit.

◆ render()

virtual void GUIScene::render ( )
pure virtual

◆ update()

Member Data Documentation

◆ guiView

GUIView* GUIScene::guiView
protected

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