The object manager.
More...
#include <ObjectManager.h>
|
|
std::vector< CObject * > | m_stdList |
| | Object list.
|
| |
|
std::vector< b2Body * > | m_stdEdgeList |
| | Edge list.
|
| |
|
|
static b2World * | m_pPhysicsWorld = nullptr |
| | Pointer to Box2D Physics World.
|
| |
|
static CBox2DRenderer * | m_pRenderer = nullptr |
| | Pointer to the renderer.
|
| |
|
static CObjectManager * | m_pObjectManager = nullptr |
| | Pointer to the object manager.
|
| |
|
static eDrawMode | m_eDrawMode = eDrawMode::Sprites |
| | Draw mode.
|
| |
The object manager manages objects.
◆ ~CObjectManager()
| CObjectManager::~CObjectManager |
( |
| ) |
|
The destructor clears the object list, which destructs all of the objects.
◆ 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()
| void CObjectManager::CreateBall |
( |
float | x, |
|
|
float | y ) |
Create a ball object and its Box2D body.
- Parameters
-
| x | Horizontal coordinate in Physics World units. |
| y | Vertical coordinate in Physics World units. |
◆ CreateCrate()
| void CObjectManager::CreateCrate |
( |
float | x, |
|
|
float | y ) |
Create a crate object and its Box2D body.
- Parameters
-
| x | Horizontal coordinate in Physics World units. |
| y | Vertical coordinate in Physics World units. |
◆ CreateWorldEdges()
| void CObjectManager::CreateWorldEdges |
( |
| ) |
|
Place Box2D edge shapes in the Physics World in places that correspond to the bottom, right, and left edges of the screen. 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.
◆ GetSize()
| const size_t CObjectManager::GetSize |
( |
| ) |
const |
Reader function for number of objects in the object list.
- Returns
- Number of objects in object list.