Robot Devastation
Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes | Static Private Attributes | List of all members
rd::ScreenManager Class Referenceabstract

Manage game screens. More...

#include <ScreenManager.hpp>

Inheritance diagram for rd::ScreenManager:
rd::SDLScreenManager

Public Member Functions

virtual bool start ()=0
 Start the ScreenManager. More...
 
virtual bool stop ()=0
 Stops the ScreenManager.
 
virtual bool isStopped () const =0
 True if the manager is not active.
 
virtual bool configure (const std::string &parameter, const std::string &value)
 Configures a parameter with a value.
 
virtual void setCurrentScreen (Screen *screen)
 Set a Screen as current Screen.
 
virtual bool show ()=0
 Display the current Screen on the game window.
 
virtual bool update (const std::string &parameter, const std::string &value)
 Update some Screen parameter through the ScreenManager.
 
virtual bool update (const std::string &parameter, const Image &value)
 Update some Screen parameter through the ScreenManager.
 
virtual bool update (const std::string &parameter, const Player &value)
 Update some Screen parameter through the ScreenManager.
 
virtual bool update (const std::string &parameter, const std::vector< Player > &value)
 Update some Screen parameter through the ScreenManager.
 
virtual bool update (const std::string &parameter, const std::vector< Target > &value)
 Update some Screen parameter through the ScreenManager.
 
virtual bool update (const std::string &parameter, const Weapon &value)
 Update some Screen parameter through the ScreenManager.
 

Static Public Member Functions

static ScreenManagergetScreenManager ()
 Get a reference to the ScreenManager. More...
 
static ScreenManagergetScreenManager (const std::string &id)
 Get a reference to the ScreenManager. More...
 
static bool destroyScreenManager ()
 Deallocate all the registered ScreenManager.
 

Static Protected Member Functions

static bool Register (ScreenManager *manager, const std::string &id)
 This function allows subclasses to install their unique instances in the singleton register to be selected later by the user.
 

Protected Attributes

Screenscreen
 

Static Private Attributes

static ScreenManagerscreenManagerInstance = NULL
 Stores the unique instance of the ScreenManager.
 
static std::string currentId = ""
 Stores the id of the current unique instance used.
 
static std::map< std::string, ScreenManager * > screenManagerRegistry = std::map<std::string, rd::ScreenManager *>()
 Stores all the ScreenManager that have been registered.
 

Detailed Description

ScreenManager can load several audio files and assign them a string for identification, so that they can be played later.

ScreenManager is a singleton text (only one instance of this object can exist, that is is shared by all the users). To use this class, we first get the reference to the ScreenManager with getScreenManager() and then we access the manager with that reference.

When the program finishes, the ScreenManager can be deallocated using destroyScreenManager().

Member Function Documentation

◆ getScreenManager() [1/2]

rd::ScreenManager * rd::ScreenManager::getScreenManager ( )
static
Returns
By default, if no id is specified, this will return a reference to the first ScreenManager that it can find in the registry, or NULL if no ScreenManager was registered.

◆ getScreenManager() [2/2]

rd::ScreenManager * rd::ScreenManager::getScreenManager ( const std::string &  id)
static
Returns
The ScreenManager registered with the given id, NULL if the id is not found in the registry.

◆ start()

virtual bool rd::ScreenManager::start ( )
pure virtual

This function is supposed to be called after ScreenManager configuration.

Implemented in rd::SDLScreenManager.


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