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

Squad planner: depth chart per position group (first choice, backup, prospect) with the manager's squad statuses, recruitment needs, age profile and contract calendar, for this season or projected to the next one (expiring contracts gone, everyone a year older). More...

#include <squad_planner_scene.h>

Inheritance diagram for SquadPlannerScene:
ManagementScene GUIScene

Classes

struct  Group
 One position group of the depth chart. More...
 
struct  Need
 A suggested need, pre-formatted. More...
 
struct  Row
 One player in the depth chart, pre-formatted. More...
 
struct  View
 Everything shown for one season. More...
 

Public Member Functions

 SquadPlannerScene (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 build (View &view, int season_offset) const
 
void renderDepth (float width)
 
void renderGroup (const Group &group)
 
void renderDetail (const Row &row)
 
void renderNeeds (float width)
 
void renderProfile (float width)
 
void addFocus (const Need &need)
 

Private Attributes

std::array< View, 2 > views
 
int season = 0
 
PlayerID selected = 0
 
bool stale = false
 
std::uint16_t season_year = 0
 

Friends

class GameFlowTest_GUIFlowLifecycle_Test
 

Additional Inherited Members

- Protected Attributes inherited from GUIScene
GUIView * guiView
 

Detailed Description

Squad planner: depth chart per position group (first choice, backup, prospect) with the manager's squad statuses, recruitment needs, age profile and contract calendar, for this season or projected to the next one (expiring contracts gone, everyone a year older).

Constructor & Destructor Documentation

◆ SquadPlannerScene()

SquadPlannerScene::SquadPlannerScene ( GUIView *  parent)
explicit

Member Function Documentation

◆ addFocus()

void SquadPlannerScene::addFocus ( const Need &  need)
private

◆ build()

void SquadPlannerScene::build ( View &  view,
int  season_offset 
) const
private

◆ getID()

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

Sidebar entry highlighted for this screen.

Implements ManagementScene.

◆ refresh()

void SquadPlannerScene::refresh ( )
overrideprotectedvirtual

Rebuilds cached view models from the game state.

Reimplemented from ManagementScene.

◆ renderContent()

void SquadPlannerScene::renderContent ( )
overrideprotectedvirtual

Draws the page body inside the content region.

Implements ManagementScene.

◆ renderDepth()

void SquadPlannerScene::renderDepth ( float  width)
private

◆ renderDetail()

void SquadPlannerScene::renderDetail ( const Row &  row)
private

◆ renderGroup()

void SquadPlannerScene::renderGroup ( const Group &  group)
private

◆ renderNeeds()

void SquadPlannerScene::renderNeeds ( float  width)
private

◆ renderProfile()

void SquadPlannerScene::renderProfile ( float  width)
private

◆ update()

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

◆ season

int SquadPlannerScene::season = 0
private

◆ season_year

std::uint16_t SquadPlannerScene::season_year = 0
private

Calendar year the season ends in.

◆ selected

PlayerID SquadPlannerScene::selected = 0
private

◆ stale

bool SquadPlannerScene::stale = false
private

A status changed: rebuild after this frame.

◆ views

std::array<View, 2> SquadPlannerScene::views
private

This season, next season.


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