Hello forum!
I was wondering if this bad design:
I have a class that handles components of my game. One of these components is the state component.
It holds a list of smart pointers to states. These states derive from their base class. The handler of this component iterates over the list and calls all the active states update methods. If a state is paused, it will be skipped.
Now, how would I handle the situation of a state being no longer required in order to free the RAM?
Should I just delete the state? That is what I feel like is the only possibility.
Is that okay? Is this bad design?
What other ways would be better?