|
Study Dungeon
1.0.0
A group project for COSC345
|
Represents the scene for editing flashcard decks. More...
#include <edit_flashcard.h>
Public Member Functions | |
| EditDeckScene (ConsoleUI::UIManager &uiManager, std::function< void()> goBack, std::function< void(FlashCardDeck &)> openEditFlashcardScene, StudySettings &studySettings) | |
| Constructs an EditDeckScene object. More... | |
| void | init () override |
| Initialises the scene. | |
| void | update () override |
| Updates the scene state. More... | |
| void | render (std::shared_ptr< ConsoleUI::ConsoleWindow > window) override |
| Renders the scene on the console window. More... | |
| void | handleInput () override |
| Handles user input for the scene. More... | |
| void | setStaticDrawn (bool staticDrawn) override |
| Sets the static drawn state of the scene. More... | |
| void | drawBookshelf (std::shared_ptr< ConsoleUI::ConsoleWindow > window) |
| Draws the books shelf art. More... | |
| void | loadDecks () |
| Loads all flashcard decks from the file system. More... | |
| const std::vector< FlashCardDeck > & | getDecks () const |
| Gets the vector of loaded flashcard decks. More... | |
| size_t | getSelectedDeckIndex () const |
| Gets the index of the currently selected deck. More... | |
| void | setSelectedDeckIndex (size_t index) |
| Sets the index of the currently selected deck. More... | |
| int | getCurrentPage () const |
| Gets the current page number for deck content display. More... | |
| void | setCurrentPage (int page) |
| Sets the current page number for deck content display. More... | |
| size_t | getMaxCardsPerPage () const |
| Gets the maximum number of cards displayed per page. More... | |
| void | setMaxCardsPerPage (size_t maxCards) |
| Sets the maximum number of cards displayed per page. More... | |
| bool | getNeedsRedraw () const |
| Gets the flag indicating if the scene needs redrawing. More... | |
| void | setNeedsRedraw (bool needsRedraw) |
| Sets the flag indicating if the scene needs redrawing. More... | |
| StudySettings & | getStudySettings () |
| Gets the study settings object. More... | |
| void | setStudySettings (const StudySettings &settings) |
| Sets the study settings object. More... | |
Public Member Functions inherited from ConsoleUI::Scene | |
| virtual | ~Scene ()=default |
| Destroy the Scene object. | |
Represents the scene for editing flashcard decks.
This class manages the user interface for editing flashcard decks, including functionality to view, add, delete, and rename decks, as well as to edit individual flashcards within a deck.
| FlashcardEdit::EditDeckScene::EditDeckScene | ( | ConsoleUI::UIManager & | uiManager, |
| std::function< void()> | goBack, | ||
| std::function< void(FlashCardDeck &)> | openEditFlashcardScene, | ||
| StudySettings & | studySettings | ||
| ) |
Constructs an EditDeckScene object.
| uiManager | Reference to the UIManager for handling UI operations. |
| goBack | Function to return to the previous scene. |
| openEditFlashcardScene | Function to open the EditFlashcardScene for a specific deck. |
| studySettings | Reference to the StudySettings object. |
| void FlashcardEdit::EditDeckScene::drawBookshelf | ( | std::shared_ptr< ConsoleUI::ConsoleWindow > | window | ) |
Draws the books shelf art.
| window | The console window to add the bookshelf art to |
|
inline |
Gets the current page number for deck content display.
|
inline |
Gets the vector of loaded flashcard decks.
|
inline |
Gets the maximum number of cards displayed per page.
|
inline |
Gets the flag indicating if the scene needs redrawing.
|
inline |
Gets the index of the currently selected deck.
|
inline |
Gets the study settings object.
|
overridevirtual |
Handles user input for the scene.
This function processes keyboard input to navigate through decks, change pages, and perform actions like adding, deleting, or renaming decks.
Implements ConsoleUI::Scene.
| void FlashcardEdit::EditDeckScene::loadDecks | ( | ) |
Loads all flashcard decks from the file system.
This function reads all .deck files from the "Decks/" directory and populates the m_decks vector with the loaded FlashCardDeck objects.
|
overridevirtual |
Renders the scene on the console window.
| window | Shared pointer to the ConsoleWindow to render on. |
This function draws the list of decks, the contents of the selected deck, and navigation instructions on the console window.
Implements ConsoleUI::Scene.
|
inline |
Sets the current page number for deck content display.
| page | The page number to set as the current page. |
|
inline |
Sets the maximum number of cards displayed per page.
| maxCards | The maximum number of cards to display per page. |
|
inline |
Sets the flag indicating if the scene needs redrawing.
| needsRedraw | Boolean value to set as the needs redraw flag. |
|
inline |
Sets the index of the currently selected deck.
| index | The index to set as the selected deck. |
|
overridevirtual |
Sets the static drawn state of the scene.
| staticDrawn | Boolean indicating whether the static elements have been drawn. |
Implements ConsoleUI::Scene.
|
inline |
Sets the study settings object.
| settings | The study settings object to set. |
|
overridevirtual |
Updates the scene state.
This function is called every frame to update the scene's state. Currently, it doesn't perform any operations as the scene doesn't require continuous updates.
Implements ConsoleUI::Scene.