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

The manager's own screen: profile card with reputation, licence and contract, career history, season finishes and honours, and the Job Centre (vacancies with the chance of an interview, applications, interviews, offers with negotiation, resignation). More...

#include <manager_scene.h>

Inheritance diagram for ManagerScene:
ManagementScene GUIScene

Classes

struct  AwardRow
 
struct  NationalOfferRow
 
struct  NationalVacancyRow
 
struct  OfferRow
 
struct  PendingAction
 A button press, executed once the page is drawn. More...
 
struct  SeasonRow
 
struct  StintRow
 
struct  VacancyRow
 

Public Types

enum class  Tab : uint8_t { PROFILE , JOB_CENTRE }
 

Public Member Functions

 ManagerScene (GUIView *parent, std::optional< Tab > tab=std::nullopt)
 
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.
 

Static Public Member Functions

static void renderUnemployedHome (GUIView *view)
 Home page of a manager out of work (drawn by the dashboard).
 

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 renderProfile ()
 
void renderProfileCard (float width)
 
void renderHonours (float width) const
 
void renderHistory () const
 
void renderSeasons () const
 
void renderJobCentre ()
 
void renderOffers ()
 
void renderInterviews ()
 
void renderVacancies ()
 
void renderVacancyDetail (const VacancyRow &row)
 
void renderInterviewDialog ()
 
void renderConfirmations ()
 
void runPendingAction ()
 
void refreshNational ()
 
void renderNationalCard (float width)
 
void renderNationalOffers ()
 
void renderNationalVacancies ()
 
void renderNationalConfirmation ()
 
bool runNationalAction (const PendingAction &action)
 

Private Attributes

Tab tab = Tab::PROFILE
 
bool unemployed = false
 
std::string subtitle
 
std::string reputation_value
 
const char * reputation_tier_key = ""
 
float reputation = 0.0f
 
std::string licence_value
 
std::string licence_note
 
std::string club_value
 
std::string club_note
 
std::string record_value
 
std::string record_note
 
std::vector< std::pair< const char *, std::string > > profile_facts
 
std::vector< StintRow > stints
 
std::vector< SeasonRow > seasons
 
std::vector< AwardRow > awards
 
std::vector< VacancyRow > vacancies
 
std::vector< OfferRow > offers
 
std::vector< TeamID > interviews
 
TeamID selected_vacancy = 0
 
std::uint32_t negotiating = 0
 
std::int64_t counter_wage = 0
 
int counter_years = 1
 
TeamID interview_club = 0
 
std::string interview_club_name
 
std::size_t interview_step = 0
 
std::array< int, INTERVIEW_TOPICS > interview_answers {}
 
std::optional< InterviewResult > interview_result
 
bool interview_requested = false
 
bool interview_close_requested = false
 
bool resign_requested = false
 
std::uint32_t accept_candidate = 0
 
std::string accept_text
 
bool accept_requested = false
 
PendingAction pending
 
bool national_job = false
 
bool national_blocked = false
 
std::string national_value
 
std::string national_note
 
std::vector< std::pair< const char *, std::string > > national_facts
 
std::vector< std::string > national_history
 
std::vector< NationalVacancyRow > national_vacancies
 
std::vector< NationalOfferRow > national_offers
 
int selected_nation = -1
 
bool resign_national_requested = false
 

Friends

class GameFlowTest_GUIFlowLifecycle_Test
 

Additional Inherited Members

- Protected Attributes inherited from GUIScene
GUIView * guiView
 

Detailed Description

The manager's own screen: profile card with reputation, licence and contract, career history, season finishes and honours, and the Job Centre (vacancies with the chance of an interview, applications, interviews, offers with negotiation, resignation).

Member Enumeration Documentation

◆ Tab

enum class ManagerScene::Tab : uint8_t
strong
Enumerator
PROFILE 
JOB_CENTRE 

Constructor & Destructor Documentation

◆ ManagerScene()

ManagerScene::ManagerScene ( GUIView *  parent,
std::optional< Tab >  tab = std::nullopt 
)
explicit

Without tab the Job Centre opens while out of work.

Member Function Documentation

◆ getID()

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

◆ navSection()

NavSection ManagerScene::navSection ( ) const
inlineoverrideprotectedvirtual

Sidebar entry highlighted for this screen.

Implements ManagementScene.

◆ refresh()

void ManagerScene::refresh ( )
overrideprotectedvirtual

Rebuilds cached view models from the game state.

Reimplemented from ManagementScene.

◆ refreshNational()

void ManagerScene::refreshNational ( )
private

◆ renderConfirmations()

void ManagerScene::renderConfirmations ( )
private

◆ renderContent()

void ManagerScene::renderContent ( )
overrideprotectedvirtual

Draws the page body inside the content region.

Implements ManagementScene.

◆ renderHistory()

void ManagerScene::renderHistory ( ) const
private

◆ renderHonours()

void ManagerScene::renderHonours ( float  width) const
private

◆ renderInterviewDialog()

void ManagerScene::renderInterviewDialog ( )
private

◆ renderInterviews()

void ManagerScene::renderInterviews ( )
private

◆ renderJobCentre()

void ManagerScene::renderJobCentre ( )
private

◆ renderNationalCard()

void ManagerScene::renderNationalCard ( float  width)
private

◆ renderNationalConfirmation()

void ManagerScene::renderNationalConfirmation ( )
private

◆ renderNationalOffers()

void ManagerScene::renderNationalOffers ( )
private

◆ renderNationalVacancies()

void ManagerScene::renderNationalVacancies ( )
private

◆ renderOffers()

void ManagerScene::renderOffers ( )
private

◆ renderProfile()

void ManagerScene::renderProfile ( )
private

◆ renderProfileCard()

void ManagerScene::renderProfileCard ( float  width)
private

◆ renderSeasons()

void ManagerScene::renderSeasons ( ) const
private

◆ renderUnemployedHome()

void ManagerScene::renderUnemployedHome ( GUIView *  view)
static

Home page of a manager out of work (drawn by the dashboard).

◆ renderVacancies()

void ManagerScene::renderVacancies ( )
private

◆ renderVacancyDetail()

void ManagerScene::renderVacancyDetail ( const VacancyRow &  row)
private

◆ runNationalAction()

bool ManagerScene::runNationalAction ( const PendingAction &  action)
private

True when the pending action was a national-team one (and ran).

◆ runPendingAction()

void ManagerScene::runPendingAction ( )
private

◆ update()

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

◆ accept_candidate

std::uint32_t ManagerScene::accept_candidate = 0
private

◆ accept_requested

bool ManagerScene::accept_requested = false
private

◆ accept_text

std::string ManagerScene::accept_text
private

◆ awards

std::vector<AwardRow> ManagerScene::awards
private

◆ club_note

std::string ManagerScene::club_note
private

◆ club_value

std::string ManagerScene::club_value
private

◆ counter_wage

std::int64_t ManagerScene::counter_wage = 0
private

◆ counter_years

int ManagerScene::counter_years = 1
private

Index: years - 1.

◆ interview_answers

std::array<int, INTERVIEW_TOPICS> ManagerScene::interview_answers {}
private

◆ interview_close_requested

bool ManagerScene::interview_close_requested = false
private

◆ interview_club

TeamID ManagerScene::interview_club = 0
private

◆ interview_club_name

std::string ManagerScene::interview_club_name
private

◆ interview_requested

bool ManagerScene::interview_requested = false
private

◆ interview_result

std::optional<InterviewResult> ManagerScene::interview_result
private

◆ interview_step

std::size_t ManagerScene::interview_step = 0
private

◆ interviews

std::vector<TeamID> ManagerScene::interviews
private

◆ licence_note

std::string ManagerScene::licence_note
private

◆ licence_value

std::string ManagerScene::licence_value
private

◆ national_blocked

bool ManagerScene::national_blocked = false
private

He has a club and is not famous enough to add a national team.

◆ national_facts

std::vector<std::pair<const char*, std::string> > ManagerScene::national_facts
private

◆ national_history

std::vector<std::string> ManagerScene::national_history
private

◆ national_job

bool ManagerScene::national_job = false
private

◆ national_note

std::string ManagerScene::national_note
private

◆ national_offers

std::vector<NationalOfferRow> ManagerScene::national_offers
private

◆ national_vacancies

std::vector<NationalVacancyRow> ManagerScene::national_vacancies
private

◆ national_value

std::string ManagerScene::national_value
private

◆ negotiating

std::uint32_t ManagerScene::negotiating = 0
private

◆ offers

std::vector<OfferRow> ManagerScene::offers
private

◆ pending

PendingAction ManagerScene::pending
private

◆ profile_facts

std::vector<std::pair<const char*, std::string> > ManagerScene::profile_facts
private

◆ record_note

std::string ManagerScene::record_note
private

◆ record_value

std::string ManagerScene::record_value
private

◆ reputation

float ManagerScene::reputation = 0.0f
private

◆ reputation_tier_key

const char* ManagerScene::reputation_tier_key = ""
private

◆ reputation_value

std::string ManagerScene::reputation_value
private

◆ resign_national_requested

bool ManagerScene::resign_national_requested = false
private

◆ resign_requested

bool ManagerScene::resign_requested = false
private

◆ seasons

std::vector<SeasonRow> ManagerScene::seasons
private

◆ selected_nation

int ManagerScene::selected_nation = -1
private

◆ selected_vacancy

TeamID ManagerScene::selected_vacancy = 0
private

◆ stints

std::vector<StintRow> ManagerScene::stints
private

◆ subtitle

std::string ManagerScene::subtitle
private

◆ tab

Tab ManagerScene::tab = Tab::PROFILE
private

◆ unemployed

bool ManagerScene::unemployed = false
private

◆ vacancies

std::vector<VacancyRow> ManagerScene::vacancies
private

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