I have a Component
class, which is the parent class, and for example a Sprite
class. Sprite
also has various children for animation, but that is not the focus of this question. I also have a component manager which holds a map<string, Component>
. I store every component I create in this map. Currently there are 12 types of components, but that will increase.
My Component
class has virtual void draw()
and update()
functions, and the same for Sprite
in this case. When I loop through the map of components, however, it only calls the Component
draw()
and update()
.
I haven’t really been able to find an answer that has actually worked for me yet.