SAGE
A Simple Academic Game Engine
Loading...
Searching...
No Matches
Sage::CComponent Class Reference

The component accessor. More...

#include <SageComponent.h>

Inheritance diagram for Sage::CComponent:

Static Protected Attributes

static std::unique_ptr< CTimerm_pTimer = std::make_unique<CTimer>()
 Pointer to a timer.
 
static std::unique_ptr< CRandomm_pRandom = std::make_unique<CRandom>()
 Pointer to a PRNG.
 
static std::unique_ptr< CSoundm_pSound = std::make_unique<CSound>()
 Pointer to sound manager.
 
static std::unique_ptr< CKeyboardm_pKeyboard
 Pointer to a keyboard handler.
 
static std::unique_ptr< CMousem_pMouse = std::make_unique<CMouse>()
 Pointer to a mouse handler.
 
static std::unique_ptr< CControllerm_pController
 Pointer to a controller.
 

Detailed Description

This singleton class encapsulates the components commonly needed to create a game: A timer, a PRNG, a keyboard handler, and a controller handler. Classes that need these pointers simply need to be derived from CComponent.

Member Data Documentation

◆ m_pController

std::unique_ptr< CController > CComponent::m_pController
staticprotected
Initial value:
=
std::make_unique<CController>()

◆ m_pKeyboard

std::unique_ptr< CKeyboard > CComponent::m_pKeyboard
staticprotected
Initial value:
=
std::make_unique<CKeyboard>()