The Object Manager.
More...
#include <ObjectManager.h>
|
|
std::vector< CObject * > | m_stdList |
| | Object list.
|
| |
|
Sage::CParticleDesc2D | m_cRingDesc |
| | Particle descriptor for ring of arrows.
|
| |
|
UINT | m_nMaxNumber = 0 |
| | Maximum number.
|
| |
|
b2Body * | m_pBase = nullptr |
| | Pointer to invisible background body.
|
| |
|
|
static b2World * | m_pPhysicsWorld = nullptr |
| | Pointer to Box2D Physics World.
|
| |
|
static CRenderer * | m_pRenderer = nullptr |
| | Pointer to the Renderer.
|
| |
|
static CObjectManager * | m_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 CCounter * | m_pCounter = nullptr |
| | Pointer to a counter.
|
| |
|
static UINT | m_nCurNum = 0 |
| | Current number.
|
| |
|
static eDrawMode | m_eDrawMode = eDrawMode::Sprites |
| | Draw mode.
|
| |
An abstract representation of all of the objects in the game.
◆ ~CObjectManager()
| CObjectManager::~CObjectManager |
( |
| ) |
|
The destructor clears the object list, which destructs all of the objects in it.
◆ AllStopped()
| bool CObjectManager::AllStopped |
( |
| ) |
|
Checks whether all of the balls that are still in play (balls that have fallen to the bottom are not in play) have stopped.
- Returns
- true if all balls in play have stopped.
◆ clear()
| void CObjectManager::clear |
( |
| ) |
|
Delete all of the entities managed by the Object Manager. This involves deleting all of the CObject instances pointed to by the object list, then clearing the object list itself.
◆ CreateBall()
| bool CObjectManager::CreateBall |
( |
| ) |
|
Place a ball in Physics World and the Object Manager. The initial position and velocity is hard-coded.
- Returns
- true if the ball was successfully created.
◆ CreateCounter()
| void CObjectManager::CreateCounter |
( |
UINT | n | ) |
|
Create the counter.
- Parameters
-
| n | Number of bits of precision. |
◆ CreateObject()
| void CObjectManager::CreateObject |
( |
eSprite | t, |
|
|
b2Body * | p ) |
Create an object in the Object Manager and link its Physics World body to it.
- Parameters
-
| t | Sprite type. |
| p | Pointer to Box2D body. |
◆ CreateWorldEdges()
| void CObjectManager::CreateWorldEdges |
( |
| ) |
|
Create world edges in Physics World. Place Box2D edge shapes in the Physics World in places that correspond to the bottom, right, and left edges of the screen in Render World. The left and right edges continue upwards for a distance. There is no top to the world.
◆ draw()
| void CObjectManager::draw |
( |
| ) |
|
Draw the game objects using Painter's Algorithm. The background is drawn first, then the game objects are asked to draw themselves in the order that they are in the object list. That is, they are drawn from back to front.
◆ HighLightBit()
| int CObjectManager::HighLightBit |
( |
UINT | n | ) |
|
Highlight a bit.
- Parameters
-
- Returns
- 0 if the bit is zero, 1 if the bit is one.
◆ Overflow()
| const bool CObjectManager::Overflow |
( |
| ) |
const |
Check for overflow.
- Returns
- true if there has been an overflow.