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

Squad list of the managed club, or of any other club (read-only). More...

#include <roster_scene.h>

Inheritance diagram for RosterScene:
ManagementScene GUIScene

Public Member Functions

 RosterScene (GUIView *parent)
 Constructs a new RosterScene for the managed club.
 
 RosterScene (GUIView *parent, TeamID teamId)
 Constructs a RosterScene for a specific club.
 
 ~RosterScene () override=default
 Destroys the RosterScene.
 
void update (float deltaTime) override
 Updates scene logic.
 
SceneID getID () const override
 Gets the ID of this scene.
 
std::optional< NavEntry > historyEntry () const override
 
- 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
 
- 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 loadRoster ()
 
void renderSummary ()
 
void renderFilters ()
 
void renderTable ()
 
void renderDetails ()
 
void renderNumberEditor (const Player &player)
 
void applyFilter ()
 
void applySort ()
 
const Player * selectedPlayer () const
 
bool isManagedClub () const
 

Private Attributes

std::optional< TeamID > team_id
 
std::vector< std::reference_wrapper< const Player > > roster_players
 
std::optional< PlayerID > selected_player_id
 
std::array< char, 64 > search_text {}
 
int role_filter_index = 0
 
int group_filter_index = 0
 
std::vector< PlayerView::PlayerRow > rows
 
std::vector< size_t > visible_rows
 
std::unordered_set< PlayerID > starters
 
std::string filtered_search
 
int filtered_role = -1
 
int filtered_group = -1
 
ImGuiID sort_column = 0
 
bool sort_ascending = true
 
std::string club_name
 
double average_age = 0.0
 
double average_overall = 0.0
 
int64_t payroll = 0
 
int expiring_contracts = 0
 
bool show_details = false
 
UI::ColumnMask table_mask = ~UI::ColumnMask{0}
 
int number_edit = 1
 
PlayerID number_edit_for = 0
 

Friends

class GameFlowTest_GUIFlowLifecycle_Test
 

Additional Inherited Members

- Protected Attributes inherited from GUIScene
GUIView * guiView
 

Detailed Description

Squad list of the managed club, or of any other club (read-only).

Constructor & Destructor Documentation

◆ RosterScene() [1/2]

RosterScene::RosterScene ( GUIView *  parent)
explicit

Constructs a new RosterScene for the managed club.

Parameters
parentPointer to the GUIView.

◆ RosterScene() [2/2]

RosterScene::RosterScene ( GUIView *  parent,
TeamID  teamId 
)

Constructs a RosterScene for a specific club.

Parameters
parentPointer to the GUIView.
teamIdClub to list; other clubs are shown read-only.

◆ ~RosterScene()

RosterScene::~RosterScene ( )
overridedefault

Destroys the RosterScene.

Member Function Documentation

◆ applyFilter()

void RosterScene::applyFilter ( )
private

◆ applySort()

void RosterScene::applySort ( )
private

◆ getID()

SceneID RosterScene::getID ( ) const
overridevirtual

Gets the ID of this scene.

Returns
The SceneID (ROSTER).

Implements GUIScene.

◆ historyEntry()

std::optional< NavEntry > RosterScene::historyEntry ( ) const
overridevirtual

The managed squad, or the club it was opened for.

Reimplemented from ManagementScene.

◆ isManagedClub()

bool RosterScene::isManagedClub ( ) const
private

◆ loadRoster()

void RosterScene::loadRoster ( )
private

◆ navSection()

NavSection RosterScene::navSection ( ) const
overrideprotectedvirtual

Sidebar entry highlighted for this screen.

Implements ManagementScene.

◆ refresh()

void RosterScene::refresh ( )
inlineoverrideprotectedvirtual

Rebuilds cached view models from the game state.

Reimplemented from ManagementScene.

◆ renderContent()

void RosterScene::renderContent ( )
overrideprotectedvirtual

Draws the page body inside the content region.

Implements ManagementScene.

◆ renderDetails()

void RosterScene::renderDetails ( )
private

◆ renderFilters()

void RosterScene::renderFilters ( )
private

◆ renderNumberEditor()

void RosterScene::renderNumberEditor ( const Player &  player)
private

◆ renderSummary()

void RosterScene::renderSummary ( )
private

◆ renderTable()

void RosterScene::renderTable ( )
private

◆ selectedPlayer()

const Player * RosterScene::selectedPlayer ( ) const
private

◆ update()

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

◆ average_age

double RosterScene::average_age = 0.0
private

◆ average_overall

double RosterScene::average_overall = 0.0
private

◆ club_name

std::string RosterScene::club_name
private

◆ expiring_contracts

int RosterScene::expiring_contracts = 0
private

◆ filtered_group

int RosterScene::filtered_group = -1
private

◆ filtered_role

int RosterScene::filtered_role = -1
private

◆ filtered_search

std::string RosterScene::filtered_search
private

◆ group_filter_index

int RosterScene::group_filter_index = 0
private

◆ number_edit

int RosterScene::number_edit = 1
private

◆ number_edit_for

PlayerID RosterScene::number_edit_for = 0
private

◆ payroll

int64_t RosterScene::payroll = 0
private

◆ role_filter_index

int RosterScene::role_filter_index = 0
private

◆ roster_players

std::vector<std::reference_wrapper<const Player> > RosterScene::roster_players
private

◆ rows

std::vector<PlayerView::PlayerRow> RosterScene::rows
private

◆ search_text

std::array<char, 64> RosterScene::search_text {}
private

◆ selected_player_id

std::optional<PlayerID> RosterScene::selected_player_id
private

◆ show_details

bool RosterScene::show_details = false
private

◆ sort_ascending

bool RosterScene::sort_ascending = true
private

◆ sort_column

ImGuiID RosterScene::sort_column = 0
private

◆ starters

std::unordered_set<PlayerID> RosterScene::starters
private

◆ table_mask

UI::ColumnMask RosterScene::table_mask = ~UI::ColumnMask{0}
private

Columns the table showed last frame (for the column picker).

◆ team_id

std::optional<TeamID> RosterScene::team_id
private

◆ visible_rows

std::vector<size_t> RosterScene::visible_rows
private

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