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

Training ground: the weekly microcycle, preset and intensity, the coming seven days, the assistant's advice and every player's focus, workload and development trend. More...

#include <training_scene.h>

Inheritance diagram for TrainingScene:
ManagementScene GUIScene

Classes

struct  AdviceLine
 One assistant recommendation, pre-formatted. More...
 
struct  DayCell
 One day of the coming week, pre-formatted. More...
 
struct  PlayerRow
 One player line of the individual training table. More...
 

Public Member Functions

 TrainingScene (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 Member Functions

void renderControls ()
 
void renderMicrocycle (float width)
 
void renderSlot (int day, bool compact)
 
void renderWeek () const
 
void renderAdvice (float width) const
 
void renderPlayers ()
 
void sortRows ()
 

Private Attributes

TeamTrainingPlan plan
 
bool has_plan = false
 
std::vector< PlayerRow > rows
 
std::vector< DayCell > week
 
std::vector< AdviceLine > advice
 
float average_condition = 0.0f
 
float familiarity = 0.0f
 
float effectiveness = 0.0f
 
int at_risk = 0
 
int sort_column = 0
 
bool sort_ascending = true
 

Friends

class GameFlowTest_GUIFlowLifecycle_Test
 

Additional Inherited Members

- Protected Attributes inherited from GUIScene
GUIView * guiView
 

Detailed Description

Training ground: the weekly microcycle, preset and intensity, the coming seven days, the assistant's advice and every player's focus, workload and development trend.

Constructor & Destructor Documentation

◆ TrainingScene()

TrainingScene::TrainingScene ( GUIView *  parent)
explicit

Member Function Documentation

◆ getID()

SceneID TrainingScene::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 TrainingScene::navSection ( ) const
inlineoverrideprotectedvirtual

Sidebar entry highlighted for this screen.

Implements ManagementScene.

◆ refresh()

void TrainingScene::refresh ( )
overrideprotectedvirtual

Rebuilds cached view models from the game state.

Reimplemented from ManagementScene.

◆ renderAdvice()

void TrainingScene::renderAdvice ( float  width) const
private

◆ renderContent()

void TrainingScene::renderContent ( )
overrideprotectedvirtual

Draws the page body inside the content region.

Implements ManagementScene.

◆ renderControls()

void TrainingScene::renderControls ( )
private

◆ renderMicrocycle()

void TrainingScene::renderMicrocycle ( float  width)
private

◆ renderPlayers()

void TrainingScene::renderPlayers ( )
private

◆ renderSlot()

void TrainingScene::renderSlot ( int  day,
bool  compact 
)
private

◆ renderWeek()

void TrainingScene::renderWeek ( ) const
private

◆ sortRows()

void TrainingScene::sortRows ( )
private

◆ update()

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

◆ advice

std::vector<AdviceLine> TrainingScene::advice
private

◆ at_risk

int TrainingScene::at_risk = 0
private

◆ average_condition

float TrainingScene::average_condition = 0.0f
private

◆ effectiveness

float TrainingScene::effectiveness = 0.0f
private

◆ familiarity

float TrainingScene::familiarity = 0.0f
private

◆ has_plan

bool TrainingScene::has_plan = false
private

◆ plan

TeamTrainingPlan TrainingScene::plan
private

◆ rows

std::vector<PlayerRow> TrainingScene::rows
private

◆ sort_ascending

bool TrainingScene::sort_ascending = true
private

◆ sort_column

int TrainingScene::sort_column = 0
private

◆ week

std::vector<DayCell> TrainingScene::week
private

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