Box2D Binary Counter
Game Physics with a 2D Physics Engine
Loading...
Searching...
No Matches
CCommon Class Reference

The common variables class. More...

#include <Common.h>

Inheritance diagram for CCommon:
Collaboration diagram for CCommon:

Static Protected Attributes

static b2World * m_pPhysicsWorld = nullptr
 Pointer to Box2D Physics World.
 
static CRendererm_pRenderer = nullptr
 Pointer to the Renderer.
 
static CObjectManagerm_pObjectManager = nullptr
 Pointer to the Object Manager.
 
static Sage::CParticleEngine2D * m_pParticleEngine = nullptr
 Pointer to particle engine.
 
static eGameState m_eGameState = eGameState::Loading
 Current game state.
 
static CCounterm_pCounter = nullptr
 Pointer to a counter.
 
static UINT m_nCurNum = 0
 Current number.
 
static eDrawMode m_eDrawMode = eDrawMode::Sprites
 Draw mode.
 

Detailed Description

CCommon is a singleton class that encapsulates things that are common to different game components, including game state variables. Making it a singleton class means that we can avoid passing its member variables around as parameters, which makes the code minisculely faster, and more importantly, reduces function clutter.