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

Scene for selecting a team. More...

#include <team_selection_scene.h>

Inheritance diagram for TeamSelectionScene:
GUIScene

Classes

struct  ClubSummary
 Cached, display-ready summary of one selectable club. More...
 
struct  LeagueEntry
 One entry of the league list, grouped by country. More...
 

Public Member Functions

 TeamSelectionScene (GUIView *parent)
 Constructs a new TeamSelectionScene.
 
 ~TeamSelectionScene () override=default
 Destroys the TeamSelectionScene.
 
void onEnter () override
 Called when entering the scene.
 
void update (float deltaTime) override
 Updates scene logic.
 
void render () override
 Renders the scene.
 
SceneID getID () const override
 Gets the ID of this scene.
 
- Public Member Functions inherited from GUIScene
 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 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 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).
 

Private Member Functions

void loadAvailableLeagues ()
 
void loadAvailableTeams ()
 
void sortClubs ()
 
void renderStackedBrowser (float width)
 Short windows: natural-height cards, only the page scrolls.
 
void renderLeagueList (float width, float height)
 Height 0 = natural height (no inner scrolling).
 
void renderClubTable (float height)
 Height 0 = every row at natural height (no inner scrolling).
 
void renderSelectedClub (float width, float height)
 Club card beside the table; the start button sits at its top.
 
void renderSelectedClubStrip ()
 One-row club card above the table for narrow windows.
 
const ClubSummary * selectedClub () const
 
void selectLeague (const LeagueEntry &entry)
 
void startCareer (TeamID teamId)
 
void startUnemployed ()
 Starts the career without a club (the Job Centre opens).
 
void backToMenu ()
 Leaves for the main menu (Back button, Escape).
 

Static Private Member Functions

static void renderClubIdentity (const ClubSummary &club, float badgeHeight, float width)
 Badge, name, nickname and reputation of a club in width.
 

Private Attributes

std::vector< LeagueEntry > league_entries
 
std::vector< std::reference_wrapper< const Team > > available_teams
 
std::optional< uint8_t > selected_league_id
 
std::optional< TeamID > selected_team_id
 
std::set< LeagueID > expanded_countries
 
bool laid_out = false
 
std::vector< ClubSummary > club_summaries
 
ImGuiID sort_column = 0
 
bool sort_ascending = false
 
ManagerSetupPanel manager_panel
 

Friends

class GameFlowTest_GUIFlowLifecycle_Test
 

Additional Inherited Members

- 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.
 
- Protected Attributes inherited from GUIScene
GUIView * guiView
 

Detailed Description

Scene for selecting a team.

Constructor & Destructor Documentation

◆ TeamSelectionScene()

TeamSelectionScene::TeamSelectionScene ( GUIView *  parent)
explicit

Constructs a new TeamSelectionScene.

Parameters
parentPointer to the GUIView.

◆ ~TeamSelectionScene()

TeamSelectionScene::~TeamSelectionScene ( )
overridedefault

Destroys the TeamSelectionScene.

Member Function Documentation

◆ backToMenu()

void TeamSelectionScene::backToMenu ( )
private

Leaves for the main menu (Back button, Escape).

◆ getID()

SceneID TeamSelectionScene::getID ( ) const
overridevirtual

Gets the ID of this scene.

Returns
The SceneID (TEAM_SELECTION).

Implements GUIScene.

◆ loadAvailableLeagues()

void TeamSelectionScene::loadAvailableLeagues ( )
private

◆ loadAvailableTeams()

void TeamSelectionScene::loadAvailableTeams ( )
private

◆ onEnter()

void TeamSelectionScene::onEnter ( )
overridevirtual

Called when entering the scene.

Reimplemented from GUIScene.

◆ render()

void TeamSelectionScene::render ( )
overridevirtual

Renders the scene.

Implements GUIScene.

◆ renderClubIdentity()

void TeamSelectionScene::renderClubIdentity ( const ClubSummary &  club,
float  badgeHeight,
float  width 
)
staticprivate

Badge, name, nickname and reputation of a club in width.

◆ renderClubTable()

void TeamSelectionScene::renderClubTable ( float  height)
private

Height 0 = every row at natural height (no inner scrolling).

◆ renderLeagueList()

void TeamSelectionScene::renderLeagueList ( float  width,
float  height 
)
private

Height 0 = natural height (no inner scrolling).

◆ renderSelectedClub()

void TeamSelectionScene::renderSelectedClub ( float  width,
float  height 
)
private

Club card beside the table; the start button sits at its top.

◆ renderSelectedClubStrip()

void TeamSelectionScene::renderSelectedClubStrip ( )
private

One-row club card above the table for narrow windows.

◆ renderStackedBrowser()

void TeamSelectionScene::renderStackedBrowser ( float  width)
private

Short windows: natural-height cards, only the page scrolls.

◆ selectedClub()

const TeamSelectionScene::ClubSummary * TeamSelectionScene::selectedClub ( ) const
private

◆ selectLeague()

void TeamSelectionScene::selectLeague ( const LeagueEntry &  entry)
private

◆ sortClubs()

void TeamSelectionScene::sortClubs ( )
private

◆ startCareer()

void TeamSelectionScene::startCareer ( TeamID  teamId)
private

◆ startUnemployed()

void TeamSelectionScene::startUnemployed ( )
private

Starts the career without a club (the Job Centre opens).

◆ update()

void TeamSelectionScene::update ( float  deltaTime)
overridevirtual

Updates scene logic.

Parameters
deltaTimeTime elapsed since last update.

Implements GUIScene.

Friends And Related Symbol Documentation

◆ GameFlowTest_GUIFlowLifecycle_Test

friend class GameFlowTest_GUIFlowLifecycle_Test
friend

Member Data Documentation

◆ available_teams

std::vector<std::reference_wrapper<const Team> > TeamSelectionScene::available_teams
private

◆ club_summaries

std::vector<ClubSummary> TeamSelectionScene::club_summaries
private

◆ expanded_countries

std::set<LeagueID> TeamSelectionScene::expanded_countries
private

Countries (top division IDs) whose lower divisions are listed.

◆ laid_out

bool TeamSelectionScene::laid_out = false
private

False until the first frame has been drawn.

◆ league_entries

std::vector<LeagueEntry> TeamSelectionScene::league_entries
private

◆ manager_panel

ManagerSetupPanel TeamSelectionScene::manager_panel
private

◆ selected_league_id

std::optional<uint8_t> TeamSelectionScene::selected_league_id
private

◆ selected_team_id

std::optional<TeamID> TeamSelectionScene::selected_team_id
private

◆ sort_ascending

bool TeamSelectionScene::sort_ascending = false
private

◆ sort_column

ImGuiID TeamSelectionScene::sort_column = 0
private

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