#include <vector>
enum ListOfGameStates
{
// List of game states
};
class GameState()
{
public:
GameStates(); // Initializes protected (global) variables
virtual ListOfGameStates run() = 0;
protected:
// Heavyweigh resource managers containing all resources and other global vars
}
class GameStateManager()
{
public:
GameStateManager(); // Creates all game states
~GameStateManager(); // Deletes all game states
void run(); // Switches from one state to another state
private:
// A vector of raw pointers to game states. GameState is a base class.
std::vector<GameState*> game_states_container;
}
I want to get rid off raw pointers so that I could have no worries about exceptions and clean-up. Is there an easy simple solution (I am a really dumb teen) or is it not worth it? Thanks!