The 8-ball Pool End Game
Ian Parberry's "Introduction to Game Physics"
Static Protected Attributes | List of all members
CCommon Class Reference

The common variables class. More...

#include <Common.h>

Inheritance diagram for CCommon:
CGame CObject CObjectManager

Static Protected Attributes

static CRendererm_pRenderer = nullptr
 Pointer to the renderer.
 
static CObjectManagerm_pObjectManager = nullptr
 Pointer to the object manager.
 
static LParticleEngine2D * m_pParticleEngine = nullptr
 Pointer to particle engine.
 
static bool m_bShowCollisions = false
 Show ball positions at TOI.
 
static bool m_bStepMode = false
 Is in step mode.
 
static bool m_bStep = false
 Step flag.
 
static float m_fXMargin = 78.0f
 Horizontal margin.
 
static float m_fYMargin = 64.0f
 Vertical margin.
 
static Vector2 m_vMargin = Vector2(m_fXMargin, m_fYMargin)
 Margins.
 
static Vector2 m_vTopLPocket = Vector2(71, 478)
 Position of top left pocket.
 
static Vector2 m_vTopRPocket = Vector2(955, 478)
 Position of top right pocket.
 
static Vector2 m_vTopCPocket = Vector2(514, 478)
 Position of top center pocket.
 
static Vector2 m_vBotLPocket = Vector2(71, 53)
 Position of bottom left pocket.
 
static Vector2 m_vBotRPocket = Vector2(955, 53)
 Position of bottom right pocket.
 
static Vector2 m_vBotCPocket = Vector2(514, 48)
 Position of bottom center pocket.
 

Detailed Description

CCommon is a singleton class that encapsulates things that are common to different game components. 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, enhances readability by reducing function clutter.