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

Club overview: board objective and confidence, stadium and ticket pricing, facilities and the competition roll of honour. More...

#include <club_scene.h>

Inheritance diagram for ClubScene:
ManagementScene GUIScene

Classes

struct  HistoryRow
 One formatted roll-of-honour line. More...
 
struct  SupporterLine
 One reason behind the supporters' mood, localised. More...
 

Public Member Functions

 ClubScene (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 renderBoard (float width)
 
void renderTargets (const GameController::BoardTargets &targets, float keyWidth) const
 
void renderStadium (float width)
 
void renderSupporters (float width)
 
void renderHistory () const
 

Private Attributes

std::vector< HistoryRow > history
 
std::optional< GameController::BoardTargets > board_targets
 
std::vector< float > confidence_trend
 
int league_position = 0
 
int ticket_price_input = 0
 
uint32_t fair_ticket_price = 0
 
uint32_t last_attendance = 0
 
std::optional< float > supporters_index
 
std::vector< SupporterLine > supporter_reasons
 

Friends

class GameFlowTest_GUIFlowLifecycle_Test
 

Additional Inherited Members

- Protected Attributes inherited from GUIScene
GUIView * guiView
 

Detailed Description

Club overview: board objective and confidence, stadium and ticket pricing, facilities and the competition roll of honour.

Constructor & Destructor Documentation

◆ ClubScene()

ClubScene::ClubScene ( GUIView *  parent)
explicit

Member Function Documentation

◆ getID()

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

Sidebar entry highlighted for this screen.

Implements ManagementScene.

◆ refresh()

void ClubScene::refresh ( )
overrideprotectedvirtual

Rebuilds cached view models from the game state.

Reimplemented from ManagementScene.

◆ renderBoard()

void ClubScene::renderBoard ( float  width)
private

◆ renderContent()

void ClubScene::renderContent ( )
overrideprotectedvirtual

Draws the page body inside the content region.

Implements ManagementScene.

◆ renderHistory()

void ClubScene::renderHistory ( ) const
private

◆ renderStadium()

void ClubScene::renderStadium ( float  width)
private

◆ renderSupporters()

void ClubScene::renderSupporters ( float  width)
private

◆ renderTargets()

void ClubScene::renderTargets ( const GameController::BoardTargets &  targets,
float  keyWidth 
) const
private

◆ update()

void ClubScene::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

Member Data Documentation

◆ board_targets

std::optional<GameController::BoardTargets> ClubScene::board_targets
private

◆ confidence_trend

std::vector<float> ClubScene::confidence_trend
private

◆ fair_ticket_price

uint32_t ClubScene::fair_ticket_price = 0
private

◆ history

std::vector<HistoryRow> ClubScene::history
private

◆ last_attendance

uint32_t ClubScene::last_attendance = 0
private

◆ league_position

int ClubScene::league_position = 0
private

◆ supporter_reasons

std::vector<SupporterLine> ClubScene::supporter_reasons
private

◆ supporters_index

std::optional<float> ClubScene::supporters_index
private

Weekly supporters' mood; unset until the first verdict.

◆ ticket_price_input

int ClubScene::ticket_price_input = 0
private

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