Hello there people,
At the moment I have a simple std::vector<Object*> objects
Object is a custom class i have created which can be text, sprite, animated sprite etc etc.
Now in my GameState class the code is starting to get a little large and I was wondering If I can do this.
The objects variable is a vector of pointers to "Object"s. Is it safe for me to do the following.
Create a new class called "StateLoader"
StateLoader will then deal with setting up the objects for whatever the game state is in
and then return a std::vector<Object*>, is this a safe thing to do or not?
When I mean safe, if is ok to populate a vector of pointers, and then set a variable to be equal to that vector of pointers? I just want to populate my objects variable outside of my gamestate class as the class is getting abit large because of all the objects being set.
If anyone can shine some light onto this it would be great.
Regards,
Canvas