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

The manager's career across every club: spells, trophies, honours, promotions and relegations, season finishes, club records and key signings (model/career_timeline.h), grouped by season or by month, with an export of the career journal as Markdown. More...

#include <timeline_scene.h>

Inheritance diagram for TimelineScene:
ManagementScene GUIScene

Classes

struct  Group
 
struct  Row
 

Public Types

enum class  Zoom : std::uint8_t { SEASON , MONTH }
 

Public Member Functions

 TimelineScene (GUIView *parent)
 
void update (float) override
 Updates scene logic.
 
SceneID getID () const override
 Gets the ID of the scene.
 
std::size_t entryCount () const
 
std::size_t groupCount () const
 
void setZoom (Zoom value)
 
std::optional< std::filesystem::path > exportJournal ()
 
- 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 regroup ()
 
void renderSummary () const
 
void renderControls ()
 
void renderEntry (std::size_t index)
 

Private Attributes

std::vector< TimelineEntry > entries
 
std::vector< Row > rows
 
std::vector< Group > groups
 
std::vector< std::pair< TeamID, std::string > > clubs
 
TeamID club_filter = 0
 
std::string club_label
 
Zoom zoom = Zoom::SEASON
 
int zoom_index = 0
 
std::string clubs_value
 
std::string matches_value
 
std::string matches_note
 
std::string win_rate_value
 
std::string trophies_value
 

Additional Inherited Members

- Protected Attributes inherited from GUIScene
GUIView * guiView
 

Detailed Description

The manager's career across every club: spells, trophies, honours, promotions and relegations, season finishes, club records and key signings (model/career_timeline.h), grouped by season or by month, with an export of the career journal as Markdown.

Member Enumeration Documentation

◆ Zoom

enum class TimelineScene::Zoom : std::uint8_t
strong
Enumerator
SEASON 
MONTH 

Constructor & Destructor Documentation

◆ TimelineScene()

TimelineScene::TimelineScene ( GUIView *  parent)
explicit

Member Function Documentation

◆ entryCount()

std::size_t TimelineScene::entryCount ( ) const
inline

◆ exportJournal()

std::optional< std::filesystem::path > TimelineScene::exportJournal ( )

Writes the career journal to the user data folder.

Returns
The file written, or nullopt when it could not be written.

◆ getID()

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

◆ groupCount()

std::size_t TimelineScene::groupCount ( ) const
inline

◆ navSection()

NavSection TimelineScene::navSection ( ) const
inlineoverrideprotectedvirtual

Sidebar entry highlighted for this screen.

Implements ManagementScene.

◆ refresh()

void TimelineScene::refresh ( )
overrideprotectedvirtual

Rebuilds cached view models from the game state.

Reimplemented from ManagementScene.

◆ regroup()

void TimelineScene::regroup ( )
private

◆ renderContent()

void TimelineScene::renderContent ( )
overrideprotectedvirtual

Draws the page body inside the content region.

Implements ManagementScene.

◆ renderControls()

void TimelineScene::renderControls ( )
private

◆ renderEntry()

void TimelineScene::renderEntry ( std::size_t  index)
private

◆ renderSummary()

void TimelineScene::renderSummary ( ) const
private

◆ setZoom()

void TimelineScene::setZoom ( Zoom  value)

◆ update()

void TimelineScene::update ( float  deltaTime)
inlineoverridevirtual

Updates scene logic.

Parameters
deltaTimeThe time elapsed since the last update.

Implements GUIScene.

Member Data Documentation

◆ club_filter

TeamID TimelineScene::club_filter = 0
private

◆ club_label

std::string TimelineScene::club_label
private

◆ clubs

std::vector<std::pair<TeamID, std::string> > TimelineScene::clubs
private

Clubs of the career, in order of the first spell.

◆ clubs_value

std::string TimelineScene::clubs_value
private

◆ entries

std::vector<TimelineEntry> TimelineScene::entries
private

◆ groups

std::vector<Group> TimelineScene::groups
private

◆ matches_note

std::string TimelineScene::matches_note
private

◆ matches_value

std::string TimelineScene::matches_value
private

◆ rows

std::vector<Row> TimelineScene::rows
private

◆ trophies_value

std::string TimelineScene::trophies_value
private

◆ win_rate_value

std::string TimelineScene::win_rate_value
private

◆ zoom

Zoom TimelineScene::zoom = Zoom::SEASON
private

◆ zoom_index

int TimelineScene::zoom_index = 0
private

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