mirror of
https://github.com/ApfelTeeSaft/gameBase.git
synced 2026-08-26 19:23:30 +00:00
28 lines
723 B
C++
28 lines
723 B
C++
#ifndef STATE_MANAGER_H
|
|
#define STATE_MANAGER_H
|
|
|
|
#include <vector>
|
|
|
|
#include "abstractAppState.h"
|
|
|
|
namespace gameBase {
|
|
class StateManager{
|
|
public:
|
|
StateManager(){}
|
|
~StateManager(){}
|
|
void update();
|
|
void attachState(AbstractAppState *a);
|
|
void dettachState(AbstractAppState*);
|
|
void dettachStateByType(int);
|
|
inline void dettachStateById(int id){appStates.erase(appStates.begin() + id);}
|
|
inline AbstractAppState* getStateById(int i){return appStates[i];}
|
|
AbstractAppState* getStateByType(int);
|
|
inline std::vector<AbstractAppState*> getAppStates(){return appStates;}
|
|
inline int getNumAppStates(){return appStates.size();}
|
|
private:
|
|
std::vector<AbstractAppState*> appStates;
|
|
};
|
|
}
|
|
|
|
#endif
|