jubilant-funicular
Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | List of all members
nta::Screen Class Referenceabstract

Represents a game screen. More...

#include <Screen.h>

Collaboration diagram for nta::Screen:
Collaboration graph
[legend]

Public Member Functions

 Screen (crstring name="UNAMED_SCREEN")
 basic constructor and destructor
 
ScreenState getState () const
 returns state of screen
 
std::string getName () const
 gets name of screen
 
int getEscIndex () const
 gets various screen indices
 
int getXIndex () const
 
int getNextIndex () const
 
int getIndex () const
 
void * getSwitchData () const
 gets the switch data (shoudl this require a key?)
 
void setManager (ScreenManager *manager, SetManagerKey key)
 Sets the manager of this screen.
 
void setIndices (int index, int escIndex, int xIndex, SetIndicesKey key)
 sets various screen indices
 
void setWindow (crstring title, SetWindowKey key)
 sets the window to associate with this screen
 
virtual void render ()=0
 renders screen
 
virtual void update ()=0
 updates screen
 
virtual void onFocus (const ScreenSwitchInfo &info)
 called when the screen becomes active
 
virtual void offFocus ()
 called when the screen is no longer active
 
virtual void init ()=0
 initializes the screen
 
void close ()
 
void esc ()
 

Protected Member Functions

const InputManagergetInput () const
 

Protected Attributes

ScreenState m_state = ScreenState::NONE
 the state of this screen
 
ScreenManagerm_manager = nullptr
 the ScreenManager that owns this screen
 
Windowm_window = nullptr
 the Window this Screen appears on
 
std::string m_name
 the name of the Screen
 
int m_nextIndex = -1
 the index of the screen to go to when m_state == SWITCH
 
void * m_switchData = nullptr
 data to pass to the new screen (via onFocus) when m_state == SWITCH
 

Private Attributes

int m_index = -1
 the index of this screen in its container
 
int m_escIndex = -1
 the index of the screen to go to when the Esc key is pressed
 
int m_xIndex = -1
 the index of the screen to go to when the window's X button is pressed
 

Detailed Description

Represents a game screen.

Definition at line 47 of file Screen.h.


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