Box2D Cannon Game
Chapter 7 of Ian Parberry's "Introduction to Game Physics with Box2D"
 All Classes Files Functions Variables Enumerations Friends Pages
Public Member Functions | Protected Attributes | Friends | List of all members
CObjectManager Class Reference

The object manager. More...

#include <ObjectManager.h>

Inheritance diagram for CObjectManager:
CHeadsUpDisplay

Public Member Functions

 CObjectManager (int size)
 Constructor.
 
 ~CObjectManager ()
 Destructor.
 
CGameObjectcreate (GameObjectType objecttype)
 Create new object.
 
void move ()
 Move all objects.
 
void draw ()
 Draw all objects.
 
void clear ()
 Clear the object list.
 
void MakeSound ()
 Make sounds.
 

Protected Attributes

CGameObject ** m_pObjectList
 List of game objects.
 
int m_nCount
 How many objects in list.
 
int m_nSize
 Maximum size of list.
 

Friends

class CObjectWorld
 

Detailed Description

The object manager.

The object manager is responsible for managing game objects.

Member Function Documentation

void CObjectManager::clear ( )

Clear the object list.

Clear out all game objects from the object list.

CGameObject * CObjectManager::create ( GameObjectType  objecttype)

Create new object.

Create a new instance of a game object.

Parameters
objecttypeThe type of the new object
void CObjectManager::draw ( )

Draw all objects.

Ask the Render World to draw all game objects.

void CObjectManager::MakeSound ( )

Make sounds.

Make sounds for all objects in the object list.

void CObjectManager::move ( )

Move all objects.

Ask the Physics World to move all game objects.