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

Season calendar: a month grid with the club's fixtures, breaks and club events, the month's agenda and the selected day's details (match report of a played fixture, the opponent's squad before it). More...

#include <calendar_scene.h>

Inheritance diagram for CalendarScene:
ManagementScene GUIScene

Classes

struct  Day
 What happens on one day of the shown month. More...
 
struct  Entry
 One agenda entry, pre-formatted. More...
 

Public Member Functions

 CalendarScene (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 showMonth (int year, int month)
 
void renderToolbar ()
 
void renderGrid (float width)
 
void renderAgenda (float width)
 
void renderDay (float width)
 
bool isToday (int day) const
 

Private Attributes

std::vector< Entry > entries
 
GameDateValue season_first
 
GameDateValue today
 
int shown_year = 0
 
int shown_month = 0
 
int days_in_month = 0
 
int first_weekday = 0
 
std::array< Day, 32 > days {}
 
std::vector< std::size_t > month_entries
 
int selected_day = 0
 
std::string month_title
 

Friends

class GameFlowTest_GUIFlowLifecycle_Test
 

Additional Inherited Members

- Protected Attributes inherited from GUIScene
GUIView * guiView
 

Detailed Description

Season calendar: a month grid with the club's fixtures, breaks and club events, the month's agenda and the selected day's details (match report of a played fixture, the opponent's squad before it).

Constructor & Destructor Documentation

◆ CalendarScene()

CalendarScene::CalendarScene ( GUIView *  parent)
explicit

Member Function Documentation

◆ getID()

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

◆ isToday()

bool CalendarScene::isToday ( int  day) const
private

◆ navSection()

NavSection CalendarScene::navSection ( ) const
inlineoverrideprotectedvirtual

Sidebar entry highlighted for this screen.

Implements ManagementScene.

◆ refresh()

void CalendarScene::refresh ( )
overrideprotectedvirtual

Rebuilds cached view models from the game state.

Reimplemented from ManagementScene.

◆ renderAgenda()

void CalendarScene::renderAgenda ( float  width)
private

◆ renderContent()

void CalendarScene::renderContent ( )
overrideprotectedvirtual

Draws the page body inside the content region.

Implements ManagementScene.

◆ renderDay()

void CalendarScene::renderDay ( float  width)
private

◆ renderGrid()

void CalendarScene::renderGrid ( float  width)
private

◆ renderToolbar()

void CalendarScene::renderToolbar ( )
private

◆ showMonth()

void CalendarScene::showMonth ( int  year,
int  month 
)
private

◆ update()

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

◆ days

std::array<Day, 32> CalendarScene::days {}
private

Index 1..31.

◆ days_in_month

int CalendarScene::days_in_month = 0
private

◆ entries

std::vector<Entry> CalendarScene::entries
private

Whole season, by date.

◆ first_weekday

int CalendarScene::first_weekday = 0
private

0 = Monday.

◆ month_entries

std::vector<std::size_t> CalendarScene::month_entries
private

Indices into entries.

◆ month_title

std::string CalendarScene::month_title
private

◆ season_first

GameDateValue CalendarScene::season_first
private

1 July of the season.

◆ selected_day

int CalendarScene::selected_day = 0
private

◆ shown_month

int CalendarScene::shown_month = 0
private

◆ shown_year

int CalendarScene::shown_year = 0
private

◆ today

GameDateValue CalendarScene::today
private

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