PROTO::KLUDGE  0.1
Quick prototyping library for games using SDL and OpenGL.
pk::ScreenState Class Referenceabstract

Abstract class for screen states, necessary for implementing the State pattern along with the Game class. More...

#include <ScreenState.hpp>

Inheritance diagram for pk::ScreenState:
Inheritance graph
Collaboration diagram for pk::ScreenState:
Collaboration graph

Public Member Functions

 ScreenState ()
 Default constructor. More...
 
virtual ~ScreenState ()
 
virtual void display ()=0
 Display the screen state in the window. Requires and override in inherited classes. More...
 
virtual bool isRunning ()=0
 Check if ScreenState is running. Requires and override in inherited classes. More...
 
Uint32 getState ()
 Get the internal state of the ScreenState. More...
 
void setState (Uint32 state)
 Set the internal state of the ScreenState. More...
 

Private Attributes

Uint32 m_state
 

Detailed Description

Abstract class for screen states, necessary for implementing the State pattern along with the Game class.

Constructor & Destructor Documentation

◆ ScreenState()

pk::ScreenState::ScreenState ( )

Default constructor.

◆ ~ScreenState()

virtual pk::ScreenState::~ScreenState ( )
virtual

Member Function Documentation

◆ display()

void pk::ScreenState::display ( )
pure virtual

Display the screen state in the window. Requires and override in inherited classes.

Implemented in pk::LevelSelectScreen, LevelScreen, MenuScreen, pk::OptionsScreen, and pk::CharacterSelectScreen.

◆ getState()

Uint32 pk::ScreenState::getState ( )
inline

Get the internal state of the ScreenState.

Returns
Uint32

◆ isRunning()

bool pk::ScreenState::isRunning ( )
pure virtual

Check if ScreenState is running. Requires and override in inherited classes.

Implemented in pk::LevelSelectScreen, LevelScreen, MenuScreen, pk::OptionsScreen, and pk::CharacterSelectScreen.

◆ setState()

void pk::ScreenState::setState ( Uint32  state)
inline

Set the internal state of the ScreenState.

Parameters
Uint32state - an unsigned int (32-bit) representing the internal state.

Member Data Documentation

◆ m_state

Uint32 pk::ScreenState::m_state
private

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