Singleton registry that owns and updates all game objects.
More...
#include <object_manager.hpp>
Singleton registry that owns and updates all game objects.
Tracks every registered GameObject, updates them each frame and forwards mouse events to them.
◆ ObjectManager()
| cangine::ObjectManager::ObjectManager |
( |
| ) |
|
Constructs the object manager.
◆ ~ObjectManager()
| cangine::ObjectManager::~ObjectManager |
( |
| ) |
|
Destroys the object manager.
◆ fireMouseEvent()
| void cangine::ObjectManager::fireMouseEvent |
( |
const MouseEvent * |
event | ) |
|
Forwards a mouse event to all registered objects.
- Parameters
-
| event | Mouse event to dispatch. |
◆ getInstance()
Returns the singleton instance.
- Returns
- Pointer to the ObjectManager instance.
◆ registerObject()
| void cangine::ObjectManager::registerObject |
( |
GameObject * |
obj | ) |
|
Registers a game object for updates and event delivery.
- Parameters
-
◆ updateAll()
| void cangine::ObjectManager::updateAll |
( |
| ) |
|
Updates every registered game object for the current frame.
◆ instance
◆ objects
| std::vector<GameObject*> cangine::ObjectManager::objects |
|
private |
All registered game objects.
◆ win
| Window* cangine::ObjectManager::win |
|
private |
Window the manager is associated with.
The documentation for this class was generated from the following files: