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

Youth academy: academy ratings, the head of youth development, board requests and the U18 league (Overview), the U18 squad with its contracts, the intake trialists with their offers (Intake) and the youngsters' progress over time (Development). More...

#include <youth_scene.h>

Inheritance diagram for YouthScene:
ManagementScene GUIScene

Classes

struct  PendingAction
 A button press, executed once the page is drawn. More...
 
struct  ResultLine
 
struct  Row
 One player line, pre-formatted at refresh time. More...
 
struct  UpgradeLine
 

Public Member Functions

 YouthScene (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 { OVERVIEW , SQUAD , INTAKE , DEVELOPMENT }
 
enum class  ListKind : uint8_t { SQUAD , ELIGIBLE , INTAKE , DEVELOPMENT }
 Which list a table shows (decides columns and actions). More...
 

Private Member Functions

void renderOverview ()
 
void renderSquad ()
 
void renderIntake ()
 
void renderDevelopment ()
 
void renderIntakeCard (float width)
 
void renderHeadCard (float width)
 
void renderBoardCard (float width)
 
void renderLeagueCard (float width)
 
void renderTable (const char *id, const std::vector< Row > &rows, ListKind kind)
 
void renderDetail (const Row &row, ListKind kind)
 
void renderChart (const Row &row, float width) const
 
void renderConfirm ()
 
void runPending ()
 
Row makeRow (const GameController::YouthPlayerView &view) const
 
void openTab (Tab tab)
 

Private Attributes

GameController::AcademyOverview overview
 
std::vector< Row > squad_rows
 
std::vector< Row > eligible_rows
 
std::vector< Row > intake_rows
 
std::vector< Row > development_rows
 
std::array< UpgradeLine, 2 > upgrades
 
std::vector< ResultLine > results
 
std::vector< UI::Outcome > form
 
std::vector< UI::BarDatum > improvers
 
std::vector< std::string > improver_values
 
std::string head_rating
 
std::string intake_line
 
std::string deadline_line
 
std::string preview_line
 
std::string league_line
 
std::string league_record
 
std::string league_goals
 
std::string intake_tab_label
 
std::string squad_title
 
GameDateValue cached_date
 
Tab requested_tab = Tab::OVERVIEW
 
bool tab_pending = false
 
bool first_refresh = true
 
PlayerID selected = 0
 
PlayerID chart_player = 0
 
PlayerID confirm_player = 0
 
bool confirm_release = false
 
bool confirm_requested = false
 
std::string confirm_text
 
PendingAction pending
 

Friends

class GameFlowTest_GUIFlowLifecycle_Test
 

Additional Inherited Members

- Protected Attributes inherited from GUIScene
GUIView * guiView
 

Detailed Description

Youth academy: academy ratings, the head of youth development, board requests and the U18 league (Overview), the U18 squad with its contracts, the intake trialists with their offers (Intake) and the youngsters' progress over time (Development).

Member Enumeration Documentation

◆ ListKind

enum class YouthScene::ListKind : uint8_t
strongprivate

Which list a table shows (decides columns and actions).

Enumerator
SQUAD 
ELIGIBLE 
INTAKE 
DEVELOPMENT 

◆ Tab

enum class YouthScene::Tab : uint8_t
strongprivate
Enumerator
OVERVIEW 
SQUAD 
INTAKE 
DEVELOPMENT 

Constructor & Destructor Documentation

◆ YouthScene()

YouthScene::YouthScene ( GUIView *  parent)
explicit

Member Function Documentation

◆ getID()

SceneID YouthScene::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()

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

◆ navSection()

NavSection YouthScene::navSection ( ) const
inlineoverrideprotectedvirtual

Sidebar entry highlighted for this screen.

Implements ManagementScene.

◆ openTab()

void YouthScene::openTab ( Tab  tab)
private

◆ refresh()

void YouthScene::refresh ( )
overrideprotectedvirtual

Rebuilds cached view models from the game state.

Reimplemented from ManagementScene.

◆ renderBoardCard()

void YouthScene::renderBoardCard ( float  width)
private

◆ renderChart()

void YouthScene::renderChart ( const Row &  row,
float  width 
) const
private

◆ renderConfirm()

void YouthScene::renderConfirm ( )
private

◆ renderContent()

void YouthScene::renderContent ( )
overrideprotectedvirtual

Draws the page body inside the content region.

Implements ManagementScene.

◆ renderDetail()

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

◆ renderDevelopment()

void YouthScene::renderDevelopment ( )
private

◆ renderHeadCard()

void YouthScene::renderHeadCard ( float  width)
private

◆ renderIntake()

void YouthScene::renderIntake ( )
private

◆ renderIntakeCard()

void YouthScene::renderIntakeCard ( float  width)
private

◆ renderLeagueCard()

void YouthScene::renderLeagueCard ( float  width)
private

◆ renderOverview()

void YouthScene::renderOverview ( )
private

◆ renderSquad()

void YouthScene::renderSquad ( )
private

◆ renderTable()

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

◆ runPending()

void YouthScene::runPending ( )
private

◆ update()

void YouthScene::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 YouthScene::cached_date
private

◆ chart_player

PlayerID YouthScene::chart_player = 0
private

◆ confirm_player

PlayerID YouthScene::confirm_player = 0
private

◆ confirm_release

bool YouthScene::confirm_release = false
private

Release a signed player (else let a trialist go).

◆ confirm_requested

bool YouthScene::confirm_requested = false
private

◆ confirm_text

std::string YouthScene::confirm_text
private

◆ deadline_line

std::string YouthScene::deadline_line
private

◆ development_rows

std::vector<Row> YouthScene::development_rows
private

◆ eligible_rows

std::vector<Row> YouthScene::eligible_rows
private

◆ first_refresh

bool YouthScene::first_refresh = true
private

◆ form

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

◆ head_rating

std::string YouthScene::head_rating
private

◆ improver_values

std::vector<std::string> YouthScene::improver_values
private

◆ improvers

std::vector<UI::BarDatum> YouthScene::improvers
private

◆ intake_line

std::string YouthScene::intake_line
private

◆ intake_rows

std::vector<Row> YouthScene::intake_rows
private

◆ intake_tab_label

std::string YouthScene::intake_tab_label
private

◆ league_goals

std::string YouthScene::league_goals
private

◆ league_line

std::string YouthScene::league_line
private

◆ league_record

std::string YouthScene::league_record
private

◆ overview

GameController::AcademyOverview YouthScene::overview
private

◆ pending

PendingAction YouthScene::pending
private

◆ preview_line

std::string YouthScene::preview_line
private

◆ requested_tab

Tab YouthScene::requested_tab = Tab::OVERVIEW
private

◆ results

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

◆ selected

PlayerID YouthScene::selected = 0
private

◆ squad_rows

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

◆ squad_title

std::string YouthScene::squad_title
private

◆ tab_pending

bool YouthScene::tab_pending = false
private

◆ upgrades

std::array<UpgradeLine, 2> YouthScene::upgrades
private

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