//Removes the current game state and adds a new one public static void changeState(State state) { if(states.Count > 0) { states.RemoveAt(states.Count); } states.Add(state); states.Last().Init(); }
//Pauses the current state and adds a new one on top of it public static void addState(State state) { if (states.Count > 0) { states.Last().Pause(); } states.Add(state); states.Last().Init(); }
//Removes the current state and resumes the next one in the list public static void removeState(State state) { if (states.Count > 0) { states.RemoveAt(states.Count); } if (states.Count > 0) { states.Last().Resume(); } }