Robot Devastation
|
Manage game screens. More...
#include <ScreenManager.hpp>
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 ¶meter, 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 ¶meter, const std::string &value) |
Update some Screen parameter through the ScreenManager. | |
virtual bool | update (const std::string ¶meter, const Image &value) |
Update some Screen parameter through the ScreenManager. | |
virtual bool | update (const std::string ¶meter, const Player &value) |
Update some Screen parameter through the ScreenManager. | |
virtual bool | update (const std::string ¶meter, const std::vector< Player > &value) |
Update some Screen parameter through the ScreenManager. | |
virtual bool | update (const std::string ¶meter, const std::vector< Target > &value) |
Update some Screen parameter through the ScreenManager. | |
virtual bool | update (const std::string ¶meter, const Weapon &value) |
Update some Screen parameter through the ScreenManager. | |
Static Public Member Functions | |
static ScreenManager * | getScreenManager () |
Get a reference to the ScreenManager. More... | |
static ScreenManager * | getScreenManager (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 | |
Screen * | screen |
Static Private Attributes | |
static ScreenManager * | screenManagerInstance = 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. | |
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().
|
static |
|
static |
|
pure virtual |
This function is supposed to be called after ScreenManager configuration.
Implemented in rd::SDLScreenManager.