|
Study Dungeon
1.0.0
A group project for COSC345
|
Represents the scene for editing individual flashcards within a deck. More...
#include <edit_flashcard.h>
Public Member Functions | |
| EditFlashcardScene (ConsoleUI::UIManager &uiManager, FlashCardDeck &deck, std::function< void()> goBack, StudySettings &studySettings) | |
| Constructs an EditFlashcardScene 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... | |
| const FlashCardDeck & | getDeck () const |
| Gets the flashcard deck being edited. More... | |
| size_t | getSelectedCardIndex () const |
| Gets the index of the currently selected flashcard. More... | |
| void | setSelectedCardIndex (size_t index) |
| Sets the index of the currently selected flashcard. More... | |
| int | getCurrentPage () const |
| Gets the current page number for flashcard list display. More... | |
| void | setCurrentPage (int page) |
| Sets the current page number for flashcard list display. More... | |
| size_t | getMaxCardsPerPage () const |
| Gets the maximum number of flashcards displayed per page. More... | |
| void | setMaxCardsPerPage (size_t maxCards) |
| Sets the maximum number of flashcards 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 individual flashcards within a deck.
This class manages the user interface for editing flashcards, including functionality to view, add, edit, and delete flashcards within a specific deck.
| FlashcardEdit::EditFlashcardScene::EditFlashcardScene | ( | ConsoleUI::UIManager & | uiManager, |
| FlashCardDeck & | deck, | ||
| std::function< void()> | goBack, | ||
| StudySettings & | studySettings | ||
| ) |
Constructs an EditFlashcardScene object.
| uiManager | Reference to the UIManager for handling UI operations. |
| deck | Reference to the FlashCardDeck being edited. |
| goBack | Function to return to the previous scene. |
| studySettings | Reference to the StudySettings object. |
|
inline |
Gets the current page number for flashcard list display.
|
inline |
Gets the flashcard deck being edited.
|
inline |
Gets the maximum number of flashcards displayed per page.
|
inline |
Gets the flag indicating if the scene needs redrawing.
|
inline |
Gets the index of the currently selected flashcard.
|
inline |
Gets the study settings object.
|
overridevirtual |
Handles user input for the scene.
This function processes keyboard input to navigate through flashcards, change pages, and perform actions like adding, editing, or deleting flashcards.
Implements ConsoleUI::Scene.
|
overridevirtual |
Renders the scene on the console window.
| window | Shared pointer to the ConsoleWindow to render on. |
This function draws the list of flashcards in the current deck, displaying the question, answer, and difficulty of each card. It also shows navigation instructions and handles pagination if necessary.
Implements ConsoleUI::Scene.
|
inline |
Sets the current page number for flashcard list display.
| page | The page number to set as the current page. |
|
inline |
Sets the maximum number of flashcards displayed per page.
| maxCards | The maximum number of flashcards 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 flashcard.
| index | The index to set as the selected flashcard. |
|
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.