Study Dungeon  1.0.0
A group project for COSC345
Public Member Functions | Data Fields
ConsoleUI::UIManager Class Reference

Defines the UI manager. More...

#include <menu.h>

Public Member Functions

 UIManager ()
 Construct a new UIManager object.
 
std::shared_ptr< ConsoleWindowgetWindow ()
 Get the Window object. More...
 
void setCurrentScene (std::shared_ptr< Scene > scene)
 Set the Current Scene object. More...
 
void init ()
 Initialise the UI.
 
void update ()
 Called each time there is a event.
 
void render ()
 Renders objects on the console window.
 
void handleInput ()
 Handles user input.
 
MenucreateMenu (const std::string &name, bool horizontal=false)
 Create the UI menu. More...
 
MenugetMenu (const std::string &name)
 Get the Menu object by it's name. More...
 
void clearMenu (const std::string &name)
 Removes the named menu from the UI. More...
 
void clearAllMenus ()
 Removes all menus from the UI.
 
AsciiArt createAsciiArt (const std::string &name, const std::vector< std::string > &artLines, int x=-1, int y=-1)
 Create a Ascii Art object. More...
 
void checkWindowResize ()
 Deteremine if the window has been resized.
 
std::vector< std::shared_ptr< Scene > > & getScenes ()
 Get the Scenes of the UI. More...
 

Data Fields

std::shared_ptr< ConsoleWindowm_window
 
std::shared_ptr< Scenem_currentScene
 
std::unordered_map< std::string, Menum_menus
 

Detailed Description

Defines the UI manager.

Member Function Documentation

◆ clearMenu()

void ConsoleUI::UIManager::clearMenu ( const std::string &  name)

Removes the named menu from the UI.

Parameters
name

◆ createAsciiArt()

AsciiArt ConsoleUI::UIManager::createAsciiArt ( const std::string &  name,
const std::vector< std::string > &  artLines,
int  x = -1,
int  y = -1 
)

Create a Ascii Art object.

Parameters
namethe name of the art
artLinesthe vector of strings representing the art
xleft most position
ytop most position
Returns
AsciiArt

◆ createMenu()

Menu & ConsoleUI::UIManager::createMenu ( const std::string &  name,
bool  horizontal = false 
)

Create the UI menu.

Parameters
nameName of the menu
horizontalis the menu layout horizontal
Returns
Menu&

◆ getMenu()

Menu & ConsoleUI::UIManager::getMenu ( const std::string &  name)

Get the Menu object by it's name.

Parameters
namethe name of the menu to retrieve
Returns
Menu&

◆ getScenes()

std::vector<std::shared_ptr<Scene> >& ConsoleUI::UIManager::getScenes ( )
inline

Get the Scenes of the UI.

Returns
std::vector<std::shared_ptr<Scene>>&

◆ getWindow()

std::shared_ptr< ConsoleWindow > ConsoleUI::UIManager::getWindow ( )

Get the Window object.

Returns
std::shared_ptr<ConsoleWindow>

◆ setCurrentScene()

void ConsoleUI::UIManager::setCurrentScene ( std::shared_ptr< Scene scene)

Set the Current Scene object.

Parameters
scene

Field Documentation

◆ m_currentScene

std::shared_ptr<Scene> ConsoleUI::UIManager::m_currentScene

pointer to the current scene

◆ m_menus

std::unordered_map<std::string, Menu> ConsoleUI::UIManager::m_menus

all of the menus in the UI

◆ m_window

std::shared_ptr<ConsoleWindow> ConsoleUI::UIManager::m_window

pointer to the current window


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