|
Study Dungeon
1.0.0
A group project for COSC345
|
A scene for browsing and selecting flashcard decks. More...
#include <flashcard_scene.h>
Public Member Functions | |
| BrowseDecksScene (ConsoleUI::UIManager &uiManager, std::function< void()> goBack, std::function< void(const FlashCardDeck &)> openDeck, StudySettings &settings) | |
| Construct a new BrowseDecksScene object. More... | |
| void | init () override |
| Initialize the scene. More... | |
| void | update () override |
| Update the scene state. More... | |
| void | render (std::shared_ptr< ConsoleUI::ConsoleWindow > window) override |
| Render the scene to the console window. More... | |
| void | handleInput () override |
| Handle user input for the scene. More... | |
| void | loadDecks () |
| Load available flashcard decks from storage. More... | |
| void | setStaticDrawn (bool staticDrawn) override |
| Sets the static drawn state of the scene. More... | |
| void | setDecksNeedReload (bool needReload) |
| void | drawBookshelf (std::shared_ptr< ConsoleUI::ConsoleWindow > window) |
Public Member Functions inherited from ConsoleUI::Scene | |
| virtual | ~Scene ()=default |
| Destroy the Scene object. | |
Data Fields | |
| std::vector< FlashCardDeck > | m_decks |
| Vector of loaded flashcard decks. | |
| size_t | m_selectedDeckIndex = 0 |
| Index of the currently selected deck. | |
| int | m_currentPage = 0 |
| Current page number when viewing deck contents. | |
A scene for browsing and selecting flashcard decks.
This class represents a user interface scene that allows users to browse through available flashcard decks, view their contents, and select a deck to study or edit.
| FlashcardApp::BrowseDecksScene::BrowseDecksScene | ( | ConsoleUI::UIManager & | uiManager, |
| std::function< void()> | goBack, | ||
| std::function< void(const FlashCardDeck &)> | openDeck, | ||
| StudySettings & | settings | ||
| ) |
Construct a new BrowseDecksScene object.
| uiManager | The UI manager responsible for handling the user interface. |
| goBack | A function to be called when the user wants to go back to the previous scene. |
| openDeck | A function to be called when the user selects a deck to open. |
|
overridevirtual |
Handle user input for the scene.
This function processes keyboard input to navigate through decks, change pages, select a deck, or go back to the previous scene.
Implements ConsoleUI::Scene.
|
overridevirtual |
Initialize the scene.
This function is called when the Scene changes to another. Currently, it doesn't perform any actions as the scene doesn't require initialization.
Implements ConsoleUI::Scene.
| void FlashcardApp::BrowseDecksScene::loadDecks | ( | ) |
Load available flashcard decks from storage.
This function reads flashcard decks from the "Decks/" directory and populates the m_decks vector with the loaded decks.
|
overridevirtual |
Render the scene to the console window.
| window | The console window to render the scene onto. |
Implements ConsoleUI::Scene.
|
overridevirtual |
Sets the static drawn state of the scene.
| staticDrawn | Boolean indicating whether the static elements have been drawn. |
Implements ConsoleUI::Scene.
|
overridevirtual |
Update the scene state.
This function is called every frame to update the scene's state. Currently, it doesn't perform any actions as the scene doesn't require continuous updates.
Implements ConsoleUI::Scene.