method name change

This commit is contained in:
devZoGok
2021-12-05 17:16:54 +02:00
parent 8391b87c08
commit fc22cbba69
2 changed files with 10 additions and 10 deletions
+4 -4
View File
@@ -6,12 +6,12 @@ namespace gameBase {
appStates[i]->update(); appStates[i]->update();
} }
void StateManager::attachState(AbstractAppState *a){ void StateManager::attachAppState(AbstractAppState *a){
appStates.push_back(a); appStates.push_back(a);
a->onAttached(); a->onAttached();
} }
void StateManager::dettachState(AbstractAppState *a){ void StateManager::dettachAppState(AbstractAppState *a){
int id=-1; int id=-1;
for(int i = 0; i < appStates.size() && id == -1; i++) for(int i = 0; i < appStates.size() && id == -1; i++)
@@ -24,7 +24,7 @@ namespace gameBase {
} }
} }
void StateManager::dettachStateByType(int type){ void StateManager::dettachAppStateByType(int type){
int id = -1; int id = -1;
for(int i = 0; i < appStates.size() && id == -1; i++) for(int i = 0; i < appStates.size() && id == -1; i++)
@@ -37,7 +37,7 @@ namespace gameBase {
} }
} }
AbstractAppState* StateManager::getStateByType(int type){ AbstractAppState* StateManager::getAppStateByType(int type){
AbstractAppState *a = nullptr; AbstractAppState *a = nullptr;
for(int i = 0; i < appStates.size() && !a; i++) for(int i = 0; i < appStates.size() && !a; i++)
+6 -6
View File
@@ -11,12 +11,12 @@ namespace gameBase {
StateManager(){} StateManager(){}
~StateManager(){} ~StateManager(){}
void update(); void update();
void attachState(AbstractAppState *a); void attachAppState(AbstractAppState *a);
void dettachState(AbstractAppState*); void dettachAppState(AbstractAppState*);
void dettachStateByType(int); void dettachAppStateByType(int);
inline void dettachStateById(int id){appStates.erase(appStates.begin() + id);} inline void dettachAppStateById(int id){appStates.erase(appStates.begin() + id);}
inline AbstractAppState* getStateById(int i){return appStates[i];} inline AbstractAppState* getAppStateById(int i){return appStates[i];}
AbstractAppState* getStateByType(int); AbstractAppState* getAppStateByType(int);
inline std::vector<AbstractAppState*> getAppStates(){return appStates;} inline std::vector<AbstractAppState*> getAppStates(){return appStates;}
inline int getNumAppStates(){return appStates.size();} inline int getNumAppStates(){return appStates.size();}
private: private: