The 8-ball Pool End Game
Game Physics with Bespoke Code
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 Sage::CSpriteRenderer * m_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 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 monostate class that encapsulates things that are common to different game components, including game state variables. Making it a monostate class means that we can avoid passing its member variables around as parameters, which makes the code minisculely faster, and more importantly, makes the code more readable by reducing function clutter.