|
Study Dungeon
1.0.0
A group project for COSC345
|
A scene for studying flashcards from a selected deck. More...
#include <flashcard_scene.h>
Public Member Functions | |
| FlashcardScene (ConsoleUI::UIManager &uiManager, const FlashCardDeck &deck, std::function< void()> goBack, std::function< void()> goToDeckSelection, std::function< void(const std::vector< int > &, int, bool)> showResults, StudySettings &studySettings) | |
| Construct a new FlashcardScene 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 | setStaticDrawn (bool staticDrawn) override |
| Sets the static drawn state of the scene. More... | |
| void | setDecksNeedReload (bool needReload) |
| void | updateCardDifficulty (size_t cardIndex, CardDifficulty difficulty) |
| void | initializeCardOrder () |
| void | nextCard () |
| Move to the next flashcard in the deck. | |
Public Member Functions inherited from ConsoleUI::Scene | |
| virtual | ~Scene ()=default |
| Destroy the Scene object. | |
Data Fields | |
| std::vector< size_t > | m_cardOrder |
| Randomized order of flashcards for the session. | |
| FlashCardDeck | m_deck |
| The flashcard deck being studied. | |
| size_t | m_currentCardIndex = 0 |
| Index of the current flashcard being shown. | |
| bool | m_showAnswer = false |
| Flag indicating whether the answer is currently visible. | |
| bool | m_lastAnswerDisplayed |
A scene for studying flashcards from a selected deck.
This class represents a user interface scene that allows users to go through flashcards in a selected deck, view questions and answers, and rate the difficulty of each card.
| FlashcardApp::FlashcardScene::FlashcardScene | ( | ConsoleUI::UIManager & | uiManager, |
| const FlashCardDeck & | deck, | ||
| std::function< void()> | goBack, | ||
| std::function< void()> | goToDeckSelection, | ||
| std::function< void(const std::vector< int > &, int, bool)> | showResults, | ||
| StudySettings & | studySettings | ||
| ) |
Construct a new FlashcardScene object.
| uiManager | The UI manager responsible for handling the user interface. |
| deck | The flashcard deck to study. |
| goBack | A function to be called when the user wants to go back to the previous scene. |
| showResults | A function to be called when the study session ends, passing difficulty counts. |
|
overridevirtual |
Handle user input for the scene.
This function processes keyboard input to show answers, select difficulty, and navigate through flashcards.
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.
|
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.