fn push(&mut self, state: Box<State<T>>, data: StateData<T>) {
        if self.running {
            let StateData { world, data } = data;
            if let Some(state) = self.state_stack.last_mut() {
                state.on_pause(StateData { world, data });
            }

            self.state_stack.push(state);
            let state = self.state_stack.last_mut().unwrap();
            state.on_start(StateData { world, data });
        }
    }
/// Pauses the active state and pushes a new state onto the state stack.
Pauses the active state and pushes a new state onto the state stack.
Pauses the active state and pushes a new state onto the state stack .
fn push(&mut self, state: Box<State<T>>, data: StateData<T>) {
        if self.running {
            let StateData { world, data } = data;
            if let Some(state) = self.state_stack.last_mut() {
                state.on_pause(StateData { world, data });
            }
            self.state_stack.push(state);
            let state = self.state_stack.last_mut().unwrap();
            state.on_start(StateData { world, data });
        }
    }
fn push ( & mut self , state : Box < State < T > > , data : StateData < T > ) { if self . running { let StateData { world , data } = data ; if let Some ( state ) = self . state_stack . last_mut ( ) { state . on_pause ( StateData { world , data } ) ; } self . state_stack . push ( state ) ; let state = self . state_stack . last_mut ( ) . unwrap ( ) ; state . on_start ( StateData { world , data } ) ; } }
Pauses the active state and pushes a new state onto the state stack.
Pauses the active state and pushes a new state onto the state stack .
&mut self
state
Box<State<T>>
data
StateData<T>
&mut self
state
Box<State<T>>
data
StateData<T>