Study Dungeon  1.0.0
A group project for COSC345
Public Member Functions
FlashcardEdit::EditFlashcardScene Class Reference

Represents the scene for editing individual flashcards within a deck. More...

#include <edit_flashcard.h>

Inheritance diagram for FlashcardEdit::EditFlashcardScene:
ConsoleUI::Scene

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 FlashCardDeckgetDeck () 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...
 
StudySettingsgetStudySettings ()
 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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ EditFlashcardScene()

FlashcardEdit::EditFlashcardScene::EditFlashcardScene ( ConsoleUI::UIManager uiManager,
FlashCardDeck deck,
std::function< void()>  goBack,
StudySettings studySettings 
)

Constructs an EditFlashcardScene object.

Parameters
uiManagerReference to the UIManager for handling UI operations.
deckReference to the FlashCardDeck being edited.
goBackFunction to return to the previous scene.
studySettingsReference to the StudySettings object.

Member Function Documentation

◆ getCurrentPage()

int FlashcardEdit::EditFlashcardScene::getCurrentPage ( ) const
inline

Gets the current page number for flashcard list display.

Returns
int The current page number.

◆ getDeck()

const FlashCardDeck& FlashcardEdit::EditFlashcardScene::getDeck ( ) const
inline

Gets the flashcard deck being edited.

Returns
const FlashCardDeck& Reference to the flashcard deck.

◆ getMaxCardsPerPage()

size_t FlashcardEdit::EditFlashcardScene::getMaxCardsPerPage ( ) const
inline

Gets the maximum number of flashcards displayed per page.

Returns
size_t The maximum number of flashcards per page.

◆ getNeedsRedraw()

bool FlashcardEdit::EditFlashcardScene::getNeedsRedraw ( ) const
inline

Gets the flag indicating if the scene needs redrawing.

Returns
bool True if the scene needs redrawing, false otherwise.

◆ getSelectedCardIndex()

size_t FlashcardEdit::EditFlashcardScene::getSelectedCardIndex ( ) const
inline

Gets the index of the currently selected flashcard.

Returns
size_t The index of the currently selected flashcard.

◆ getStudySettings()

StudySettings& FlashcardEdit::EditFlashcardScene::getStudySettings ( )
inline

Gets the study settings object.

Returns
StudySettings& Reference to the study settings object.

◆ handleInput()

void FlashcardEdit::EditFlashcardScene::handleInput ( )
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.

◆ render()

void FlashcardEdit::EditFlashcardScene::render ( std::shared_ptr< ConsoleUI::ConsoleWindow window)
overridevirtual

Renders the scene on the console window.

Parameters
windowShared 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.

◆ setCurrentPage()

void FlashcardEdit::EditFlashcardScene::setCurrentPage ( int  page)
inline

Sets the current page number for flashcard list display.

Parameters
pageThe page number to set as the current page.

◆ setMaxCardsPerPage()

void FlashcardEdit::EditFlashcardScene::setMaxCardsPerPage ( size_t  maxCards)
inline

Sets the maximum number of flashcards displayed per page.

Parameters
maxCardsThe maximum number of flashcards to display per page.

◆ setNeedsRedraw()

void FlashcardEdit::EditFlashcardScene::setNeedsRedraw ( bool  needsRedraw)
inline

Sets the flag indicating if the scene needs redrawing.

Parameters
needsRedrawBoolean value to set as the needs redraw flag.

◆ setSelectedCardIndex()

void FlashcardEdit::EditFlashcardScene::setSelectedCardIndex ( size_t  index)
inline

Sets the index of the currently selected flashcard.

Parameters
indexThe index to set as the selected flashcard.

◆ setStaticDrawn()

void FlashcardEdit::EditFlashcardScene::setStaticDrawn ( bool  staticDrawn)
overridevirtual

Sets the static drawn state of the scene.

Parameters
staticDrawnBoolean indicating whether the static elements have been drawn.

Implements ConsoleUI::Scene.

◆ setStudySettings()

void FlashcardEdit::EditFlashcardScene::setStudySettings ( const StudySettings settings)
inline

Sets the study settings object.

Parameters
settingsThe study settings object to set.

◆ update()

void FlashcardEdit::EditFlashcardScene::update ( )
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.


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