pub fn push(&mut self, mut state: Box<dyn State<S>>, state_data: &mut S) {
        if let Some(state) = self.state_stack.last_mut() {
            state.on_pause(state_data);
        }

        state.on_start(state_data);
        self.state_stack.push(state);
    }
/// Push a state on the stack and start it.
/// Pauses any previously active state.
Push a state on the stack and start it.
Pauses any previously active state.
Push a state on the stack and start it . Pauses any previously active state .
pub fn push(&mut self, mut state: Box<dyn State<S>>, state_data: &mut S) {
        if let Some(state) = self.state_stack.last_mut() {
            state.on_pause(state_data);
        }
        state.on_start(state_data);
        self.state_stack.push(state);
    }
pub fn push ( & mut self , mut state : Box < dyn State < S > > , state_data : & mut S ) { if let Some ( state ) = self . state_stack . last_mut ( ) { state . on_pause ( state_data ) ; } state . on_start ( state_data ) ; self . state_stack . push ( state ) ; }
Push a state on the stack and start it.
Push a state on the stack and start it .
&mut self
state
Box<dyn State<S>>
state_data
&mut S
&mut self
state
Box<dyn State<S>>
state_data
&mut S