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

Backroom staff: current coaches, medics and scouts with ratings and responsibilities, their impact on the squad, contract actions and a filterable staff market. More...

#include <staff_scene.h>

Inheritance diagram for StaffScene:
ManagementScene GUIScene

Classes

struct  PendingAction
 A button press, executed once the tables are drawn. More...
 
struct  Responsibility
 Who covers an area and how well. More...
 
struct  StaffRow
 One staff line, pre-formatted. More...
 

Public Member Functions

 StaffScene (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 renderStaff (float width)
 
void renderImpact (float width) const
 
void renderMarket ()
 
void renderFilters ()
 
void renderGroups (const char *id, const std::vector< StaffRow > &rows, bool market)
 
void renderDetail (const StaffRow &row, bool market)
 
void renderReleaseConfirm ()
 
void rebuildMarket ()
 
void showResult (int result, const char *success_key)
 

Private Attributes

std::vector< StaffRow > staff_rows
 
std::vector< StaffRow > market_rows
 
std::vector< Responsibility > responsibilities
 
StaffEffects effects
 
int role_filter = -1
 
int min_rating = 0
 
int hire_years = 2
 
StaffID selected = 0
 
StaffID release_candidate = 0
 
std::string release_text
 
bool release_requested = false
 
PendingAction pending
 

Friends

class GameFlowTest_GUIFlowLifecycle_Test
 

Additional Inherited Members

- Protected Attributes inherited from GUIScene
GUIView * guiView
 

Detailed Description

Backroom staff: current coaches, medics and scouts with ratings and responsibilities, their impact on the squad, contract actions and a filterable staff market.

Constructor & Destructor Documentation

◆ StaffScene()

StaffScene::StaffScene ( GUIView *  parent)
explicit

Member Function Documentation

◆ getID()

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

Sidebar entry highlighted for this screen.

Implements ManagementScene.

◆ rebuildMarket()

void StaffScene::rebuildMarket ( )
private

◆ refresh()

void StaffScene::refresh ( )
overrideprotectedvirtual

Rebuilds cached view models from the game state.

Reimplemented from ManagementScene.

◆ renderContent()

void StaffScene::renderContent ( )
overrideprotectedvirtual

Draws the page body inside the content region.

Implements ManagementScene.

◆ renderDetail()

void StaffScene::renderDetail ( const StaffRow &  row,
bool  market 
)
private

◆ renderFilters()

void StaffScene::renderFilters ( )
private

◆ renderGroups()

void StaffScene::renderGroups ( const char *  id,
const std::vector< StaffRow > &  rows,
bool  market 
)
private

Rows grouped by department, each group with a header and a table.

◆ renderImpact()

void StaffScene::renderImpact ( float  width) const
private

◆ renderMarket()

void StaffScene::renderMarket ( )
private

◆ renderReleaseConfirm()

void StaffScene::renderReleaseConfirm ( )
private

◆ renderStaff()

void StaffScene::renderStaff ( float  width)
private

◆ showResult()

void StaffScene::showResult ( int  result,
const char *  success_key 
)
private

◆ update()

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

◆ effects

StaffEffects StaffScene::effects
private

◆ hire_years

int StaffScene::hire_years = 2
private

◆ market_rows

std::vector<StaffRow> StaffScene::market_rows
private

◆ min_rating

int StaffScene::min_rating = 0
private

◆ pending

PendingAction StaffScene::pending
private

◆ release_candidate

StaffID StaffScene::release_candidate = 0
private

◆ release_requested

bool StaffScene::release_requested = false
private

◆ release_text

std::string StaffScene::release_text
private

◆ responsibilities

std::vector<Responsibility> StaffScene::responsibilities
private

◆ role_filter

int StaffScene::role_filter = -1
private

-1: every role.

◆ selected

StaffID StaffScene::selected = 0
private

Row whose detail strip is open (0: none).

◆ staff_rows

std::vector<StaffRow> StaffScene::staff_rows
private

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