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

Under-21 squad: the U21 players with their minutes and contracts (Squad), the country's U21 league with the latest results and the over-age places (League), and the first-team and U18 players who may join the U21s (Candidates). Row actions live in the selected row's detail strip, as on the youth academy screen. More...

#include <reserves_scene.h>

Inheritance diagram for ReservesScene:
ManagementScene GUIScene

Classes

struct  PendingAction
 
struct  ResultLine
 
struct  Row
 One player line, pre-formatted at refresh time. More...
 
struct  TableLine
 

Public Member Functions

 ReservesScene (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 Types

enum class  Tab : uint8_t { SQUAD , LEAGUE , CANDIDATES }
 
enum class  ListKind : uint8_t { SQUAD , CANDIDATES }
 

Private Member Functions

void renderSquad ()
 
void renderLeague ()
 
void renderCandidates ()
 
void renderQuotaCard (float width) const
 
void renderResultsCard (float width)
 
void renderTable (const char *id, const std::vector< Row > &rows, ListKind kind)
 
void renderDetail (const Row &row, ListKind kind)
 
void runPending ()
 
Row makeRow (const GameController::YouthPlayerView &view) const
 
void openTab (Tab tab)
 

Private Attributes

GameController::ReserveOverview overview
 
std::vector< Row > squad_rows
 
std::vector< Row > candidate_rows
 
std::vector< TableLine > table
 
std::vector< ResultLine > results
 
std::vector< UI::Outcome > form
 
std::string subtitle
 
std::string squad_title
 
std::string league_title
 
std::string league_line
 
std::string quota_outfield
 
std::string quota_keepers
 
std::string squad_size
 
GameDateValue cached_date
 
PlayerID selected = 0
 
Tab requested_tab = Tab::SQUAD
 
bool tab_pending = false
 
PendingAction pending
 

Friends

class GameFlowTest_GUIFlowLifecycle_Test
 

Additional Inherited Members

- Protected Attributes inherited from GUIScene
GUIView * guiView
 

Detailed Description

Under-21 squad: the U21 players with their minutes and contracts (Squad), the country's U21 league with the latest results and the over-age places (League), and the first-team and U18 players who may join the U21s (Candidates). Row actions live in the selected row's detail strip, as on the youth academy screen.

Member Enumeration Documentation

◆ ListKind

enum class ReservesScene::ListKind : uint8_t
strongprivate
Enumerator
SQUAD 
CANDIDATES 

◆ Tab

enum class ReservesScene::Tab : uint8_t
strongprivate
Enumerator
SQUAD 
LEAGUE 
CANDIDATES 

Constructor & Destructor Documentation

◆ ReservesScene()

ReservesScene::ReservesScene ( GUIView *  parent)
explicit

Member Function Documentation

◆ getID()

SceneID ReservesScene::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.

◆ makeRow()

ReservesScene::Row ReservesScene::makeRow ( const GameController::YouthPlayerView &  view) const
private

◆ navSection()

NavSection ReservesScene::navSection ( ) const
inlineoverrideprotectedvirtual

Sidebar entry highlighted for this screen.

Implements ManagementScene.

◆ openTab()

void ReservesScene::openTab ( Tab  tab)
private

◆ refresh()

void ReservesScene::refresh ( )
overrideprotectedvirtual

Rebuilds cached view models from the game state.

Reimplemented from ManagementScene.

◆ renderCandidates()

void ReservesScene::renderCandidates ( )
private

◆ renderContent()

void ReservesScene::renderContent ( )
overrideprotectedvirtual

Draws the page body inside the content region.

Implements ManagementScene.

◆ renderDetail()

void ReservesScene::renderDetail ( const Row &  row,
ListKind  kind 
)
private

◆ renderLeague()

void ReservesScene::renderLeague ( )
private

◆ renderQuotaCard()

void ReservesScene::renderQuotaCard ( float  width) const
private

◆ renderResultsCard()

void ReservesScene::renderResultsCard ( float  width)
private

◆ renderSquad()

void ReservesScene::renderSquad ( )
private

◆ renderTable()

void ReservesScene::renderTable ( const char *  id,
const std::vector< Row > &  rows,
ListKind  kind 
)
private

◆ runPending()

void ReservesScene::runPending ( )
private

◆ update()

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

◆ cached_date

GameDateValue ReservesScene::cached_date
private

◆ candidate_rows

std::vector<Row> ReservesScene::candidate_rows
private

◆ form

std::vector<UI::Outcome> ReservesScene::form
private

◆ league_line

std::string ReservesScene::league_line
private

◆ league_title

std::string ReservesScene::league_title
private

◆ overview

GameController::ReserveOverview ReservesScene::overview
private

◆ pending

PendingAction ReservesScene::pending
private

◆ quota_keepers

std::string ReservesScene::quota_keepers
private

◆ quota_outfield

std::string ReservesScene::quota_outfield
private

◆ requested_tab

Tab ReservesScene::requested_tab = Tab::SQUAD
private

◆ results

std::vector<ResultLine> ReservesScene::results
private

◆ selected

PlayerID ReservesScene::selected = 0
private

◆ squad_rows

std::vector<Row> ReservesScene::squad_rows
private

◆ squad_size

std::string ReservesScene::squad_size
private

◆ squad_title

std::string ReservesScene::squad_title
private

◆ subtitle

std::string ReservesScene::subtitle
private

◆ tab_pending

bool ReservesScene::tab_pending = false
private

◆ table

std::vector<TableLine> ReservesScene::table
private

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