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

Full profile of one player: bio and contract, fitness and form, attributes grouped by category, position suitability, season and career statistics, transfer history and context actions. More...

#include <player_profile_scene.h>

Inheritance diagram for PlayerProfileScene:
ManagementScene GUIScene

Classes

struct  AttributeLine
 An attribute; low == high == value when known exactly. More...
 
struct  AttributeSection
 
struct  ReportSummary
 The latest scout report, formatted for display. More...
 
struct  StatsRow
 One statistics row (a competition this season, or a season). More...
 
struct  TransferLine
 One move in the player's transfer history. More...
 

Public Member Functions

 PlayerProfileScene (GUIView *parent, PlayerID playerId)
 
void update (float deltaTime) override
 Updates scene logic.
 
SceneID getID () const override
 Gets the ID of the 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 renderHeader ()
 
void renderActions ()
 
void renderBio (const Player &player, float width, float height) const
 
void renderStatus (float width, float height) const
 
void renderAttributes (float width, float height) const
 
void renderSuitability (float width, float height) const
 
void renderScouting (float width, float height)
 
void renderStatistics (float width, float height)
 
void renderStatsTable (const std::vector< StatsRow > &rows, bool career) const
 
void renderTransfers () const
 
void renderDialogs ()
 
void sendScout ()
 
const Player * player () const
 
bool isOwnPlayer () const
 

Private Attributes

PlayerID player_id
 
PlayerView::PlayerRow row
 
std::string club_name
 
std::string nationality
 
std::string clause_text
 
std::vector< PlayerView::RoleFit > fits
 
std::vector< AttributeSection > sections
 
std::vector< StatsRow > season_rows
 
std::vector< StatsRow > career_rows
 
std::vector< TransferLine > transfers
 
PlayerDynamics dynamics
 
float form = 0.0f
 
uint8_t league_ban = 0
 
uint8_t cup_ban = 0
 
const char * squad_role_key = nullptr
 
float potential_low = 0.0f
 
float potential_high = 0.0f
 
bool scouted = false
 
uint8_t knowledge = 0
 
std::string overall_range
 
std::optional< ReportSummary > latest_report
 
bool shortlisted = false
 
bool being_scouted = false
 
int64_t scout_cost = 0
 
bool window_open = false
 
bool list_confirm_requested = false
 
bool renew_requested = false
 
ContractTalksDialog contract_talks
 
PlayerTalkDialog talk_dialog
 

Friends

class GameFlowTest_GUIFlowLifecycle_Test
 
class GameFlowTest_ManagementScreensMidSeason_Test
 

Additional Inherited Members

- Protected Attributes inherited from GUIScene
GUIView * guiView
 

Detailed Description

Full profile of one player: bio and contract, fitness and form, attributes grouped by category, position suitability, season and career statistics, transfer history and context actions.

The managed club's players are shown exactly. Every other player is shown through the club's scouting knowledge only (GameController::getScoutedView): estimated attributes with their likely range, an estimated overall and value, the latest scout report, and recruitment actions (scout, shortlist, make an offer). Hidden true attributes are never displayed for them.

Constructor & Destructor Documentation

◆ PlayerProfileScene()

PlayerProfileScene::PlayerProfileScene ( GUIView *  parent,
PlayerID  playerId 
)

Member Function Documentation

◆ getID()

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

◆ historyEntry()

std::optional< NavEntry > PlayerProfileScene::historyEntry ( ) const
inlineoverridevirtual

The screen's sidebar section; detail screens override it.

Reimplemented from ManagementScene.

◆ isOwnPlayer()

bool PlayerProfileScene::isOwnPlayer ( ) const
private

◆ navSection()

NavSection PlayerProfileScene::navSection ( ) const
overrideprotectedvirtual

Sidebar entry highlighted for this screen.

Implements ManagementScene.

◆ player()

const Player * PlayerProfileScene::player ( ) const
private

◆ refresh()

void PlayerProfileScene::refresh ( )
overrideprotectedvirtual

Rebuilds cached view models from the game state.

Reimplemented from ManagementScene.

◆ renderActions()

void PlayerProfileScene::renderActions ( )
private

◆ renderAttributes()

void PlayerProfileScene::renderAttributes ( float  width,
float  height 
) const
private

◆ renderBio()

void PlayerProfileScene::renderBio ( const Player &  player,
float  width,
float  height 
) const
private

◆ renderContent()

void PlayerProfileScene::renderContent ( )
overrideprotectedvirtual

Draws the page body inside the content region.

Implements ManagementScene.

◆ renderDialogs()

void PlayerProfileScene::renderDialogs ( )
private

◆ renderHeader()

void PlayerProfileScene::renderHeader ( )
private

◆ renderScouting()

void PlayerProfileScene::renderScouting ( float  width,
float  height 
)
private

◆ renderStatistics()

void PlayerProfileScene::renderStatistics ( float  width,
float  height 
)
private

◆ renderStatsTable()

void PlayerProfileScene::renderStatsTable ( const std::vector< StatsRow > &  rows,
bool  career 
) const
private

◆ renderStatus()

void PlayerProfileScene::renderStatus ( float  width,
float  height 
) const
private

◆ renderSuitability()

void PlayerProfileScene::renderSuitability ( float  width,
float  height 
) const
private

◆ renderTransfers()

void PlayerProfileScene::renderTransfers ( ) const
private

◆ sendScout()

void PlayerProfileScene::sendScout ( )
private

◆ update()

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

◆ GameFlowTest_ManagementScreensMidSeason_Test

friend class GameFlowTest_ManagementScreensMidSeason_Test
friend

Member Data Documentation

◆ being_scouted

bool PlayerProfileScene::being_scouted = false
private

◆ career_rows

std::vector<StatsRow> PlayerProfileScene::career_rows
private

◆ clause_text

std::string PlayerProfileScene::clause_text
private

His release clause, empty if none.

◆ club_name

std::string PlayerProfileScene::club_name
private

◆ contract_talks

ContractTalksDialog PlayerProfileScene::contract_talks
private

◆ cup_ban

uint8_t PlayerProfileScene::cup_ban = 0
private

◆ dynamics

PlayerDynamics PlayerProfileScene::dynamics
private

◆ fits

std::vector<PlayerView::RoleFit> PlayerProfileScene::fits
private

◆ form

float PlayerProfileScene::form = 0.0f
private

◆ knowledge

uint8_t PlayerProfileScene::knowledge = 0
private

◆ latest_report

std::optional<ReportSummary> PlayerProfileScene::latest_report
private

◆ league_ban

uint8_t PlayerProfileScene::league_ban = 0
private

◆ list_confirm_requested

bool PlayerProfileScene::list_confirm_requested = false
private

◆ nationality

std::string PlayerProfileScene::nationality
private

◆ overall_range

std::string PlayerProfileScene::overall_range
private

◆ player_id

PlayerID PlayerProfileScene::player_id
private

◆ potential_high

float PlayerProfileScene::potential_high = 0.0f
private

◆ potential_low

float PlayerProfileScene::potential_low = 0.0f
private

◆ renew_requested

bool PlayerProfileScene::renew_requested = false
private

◆ row

PlayerView::PlayerRow PlayerProfileScene::row
private

◆ scout_cost

int64_t PlayerProfileScene::scout_cost = 0
private

◆ scouted

bool PlayerProfileScene::scouted = false
private

◆ season_rows

std::vector<StatsRow> PlayerProfileScene::season_rows
private

◆ sections

std::vector<AttributeSection> PlayerProfileScene::sections
private

◆ shortlisted

bool PlayerProfileScene::shortlisted = false
private

◆ squad_role_key

const char* PlayerProfileScene::squad_role_key = nullptr
private

◆ talk_dialog

PlayerTalkDialog PlayerProfileScene::talk_dialog
private

◆ transfers

std::vector<TransferLine> PlayerProfileScene::transfers
private

◆ window_open

bool PlayerProfileScene::window_open = false
private

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