SUNENGINE 0.0.2
A simple and bright C++ game engine.
 
Loading...
Searching...
No Matches
UpdatableManager.h
1#ifndef UpdatableManager_H
2#define UpdatableManager_H
3
4#include <list>
5#include "UpdateRegistrationCommand.h"
6#include "UpdateDeregistrationCommand.h"
7
8class Updatable;
9
17class UpdatableManager
18{
19private:
23 using StorageList = std::list<Updatable*>;
24
29
30public:
31 UpdatableManager() = default;
32 UpdatableManager(const UpdatableManager&) = delete;
33 UpdatableManager& operator=(const UpdatableManager&) = delete;
34 ~UpdatableManager();
35
40 void Register(Updatable* up);
41
46 void Deregister(Updatable* up);
47
51 void ProcessElements();
52
56 using StorageListRef = StorageList::iterator;
57};
58
59#endif
Base class for objects that can be updated in the game loop.
Definition Updatable.h:19
void ProcessElements()
Processes the update of all registered GameObjects.
Definition UpdatableManager.cpp:20
void Deregister(Updatable *up)
Deregisters an updatable GameObject.
Definition UpdatableManager.cpp:15
void Register(Updatable *up)
Registers an updatable GameObject.
Definition UpdatableManager.cpp:10
StorageList::iterator StorageListRef
Type alias for the storage list iterator.
Definition UpdatableManager.h:56
std::list< Updatable * > StorageList
Type alias for the storage list of updatable GameObjects.
Definition UpdatableManager.h:23
StorageList storageList
The storage list of updatable GameObjects.
Definition UpdatableManager.h:28