#pragma once class Crawler; class State_GameRun; namespace States{ enum State{ GAME_RUN }; }; class GameState{ public: inline static GameState*STATE=nullptr; inline static std::mapstates; virtual void OnStateChange(GameState*prevState)=0; virtual void OnUserUpdate(Crawler*game)=0; virtual void Draw(Crawler*game)=0; static inline void ChangeState(States::State newState){ GameState*prevState=STATE; STATE=states[newState]; STATE->OnStateChange(prevState); } };