BARE2D
BARE2D::ScreenList Class Reference

Holds and connects all of the screens used in the program in a list. Keeps track of the previous screen. Contains functions to move to the next or previous screens. More...

#include <ScreenList.hpp>

+ Collaboration diagram for BARE2D::ScreenList:

Public Member Functions

 ScreenList ()
 
 ~ScreenList ()
 Destroys the screen list, "taking care" of the screen pointers it owns. More...
 
void addScreen (Screen *screen)
 Adds a screen to the list of screens, AKA the screen list. Requires non-nullptr. Also, calls the screen's initScreen function. More...
 
void addEntryScreen (Screen *screen)
 Adds a screen, and sets the current screen to this one. More...
 
void moveToNextScreen ()
 Moves to the next screen, updates needed variables. Also, exits old screen and enters new one. More...
 
void moveToPreviousScreen ()
 Moves to the previous screen. Similar to moveToNextScreen, in that it makes sure everything's good! More...
 
ScreengetCurrentScreen ()
 

Private Attributes

std::vector< Screen * > m_screens
 
Screenm_previousScreen = nullptr
 
Screenm_currentScreen = nullptr
 

Detailed Description

Holds and connects all of the screens used in the program in a list. Keeps track of the previous screen. Contains functions to move to the next or previous screens.

Definition at line 13 of file ScreenList.hpp.

Constructor & Destructor Documentation

◆ ScreenList()

BARE2D::ScreenList::ScreenList ( )

Definition at line 7 of file ScreenList.cpp.

◆ ~ScreenList()

BARE2D::ScreenList::~ScreenList ( )

Destroys the screen list, "taking care" of the screen pointers it owns.

Parameters
screen

Definition at line 11 of file ScreenList.cpp.

References m_currentScreen, m_previousScreen, and m_screens.

Member Function Documentation

◆ addEntryScreen()

void BARE2D::ScreenList::addEntryScreen ( Screen screen)

Adds a screen, and sets the current screen to this one.

Parameters
screenA pointer to the entry screen.

Definition at line 27 of file ScreenList.cpp.

References addScreen(), and m_currentScreen.

+ Here is the call graph for this function:

◆ addScreen()

void BARE2D::ScreenList::addScreen ( Screen screen)

Adds a screen to the list of screens, AKA the screen list. Requires non-nullptr. Also, calls the screen's initScreen function.

Parameters
screenA pointer to the screen to be added.

Definition at line 21 of file ScreenList.cpp.

References BARE2D::Screen::initScreen(), and m_screens.

Referenced by addEntryScreen().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCurrentScreen()

Screen * BARE2D::ScreenList::getCurrentScreen ( )
Returns
The current screen.

Definition at line 69 of file ScreenList.cpp.

References m_currentScreen.

◆ moveToNextScreen()

void BARE2D::ScreenList::moveToNextScreen ( )

Moves to the next screen, updates needed variables. Also, exits old screen and enters new one.

Definition at line 33 of file ScreenList.cpp.

References BARE2D::Screen::getNextScreenIndex(), m_currentScreen, m_screens, BARE2D::Screen::onEntry(), and BARE2D::Screen::onExit().

+ Here is the call graph for this function:

◆ moveToPreviousScreen()

void BARE2D::ScreenList::moveToPreviousScreen ( )

Moves to the previous screen. Similar to moveToNextScreen, in that it makes sure everything's good!

Definition at line 50 of file ScreenList.cpp.

References m_currentScreen, m_previousScreen, BARE2D::Screen::onEntry(), and BARE2D::Screen::onExit().

+ Here is the call graph for this function:

Field Documentation

◆ m_currentScreen

Screen* BARE2D::ScreenList::m_currentScreen = nullptr
private

◆ m_previousScreen

Screen* BARE2D::ScreenList::m_previousScreen = nullptr
private

Definition at line 53 of file ScreenList.hpp.

Referenced by moveToPreviousScreen(), and ~ScreenList().

◆ m_screens

std::vector<Screen*> BARE2D::ScreenList::m_screens
private

Definition at line 52 of file ScreenList.hpp.

Referenced by addScreen(), moveToNextScreen(), and ~ScreenList().


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