+ switch (action.type)
+ {
+ case Action::POP_ACTION:
+ assert(!m_screen_stack.empty());
+ if (current_screen == m_screen_stack.back().get())
+ {
+ m_screen_stack.back()->leave();
+ }
+ m_screen_stack.pop_back();
+ break;
+
+ case Action::PUSH_ACTION:
+ assert(action.screen);
+
+ if (!m_screen_stack.empty())
+ {
+ if (current_screen == m_screen_stack.back().get())
+ {
+ m_screen_stack.back()->leave();
+ }
+ }
+ m_screen_stack.push_back(std::move(action.screen));
+ break;