pub fn transition(&mut self, request: Trans<T, E>, data: StateData<'_, T>) {
        if self.running {
            match request {
                Trans::None => (),
                Trans::Pop => self.pop(data),
                Trans::Push(state) => self.push(state, data),
                Trans::Switch(state) => self.switch(state, data),
                Trans::Replace(state) => self.replace(state, data),
                Trans::NewStack(states) => self.new_stack(states, data),
                Trans::Sequence(sequence) => {
                    for trans in sequence {
                        let temp_data = StateData {
                            context: data.context,
                            world: data.world,
                            data: data.data,
                        };
                        self.transition(trans, temp_data);
                    }
                }
                Trans::Quit => self.stop(data),
            }
        }
    }
/// Performs a state transition.
/// Usually called by update or fixed_update by the user's defined `State`.
/// This method can also be called when there are one or multiple `Trans` stored in the
/// global `EventChannel<TransEvent<T, E>>`. Such `Trans` will be passed to this method
/// sequentially in the order of insertion.
Performs a state transition.
Usually called by update or fixed_update by the user's defined `State`.
This method can also be called when there are one or multiple `Trans` stored in the
global `EventChannel>`. Such `Trans` will be passed to this method
sequentially in the order of insertion.
Performs a state transition . Usually called by update or fixed_update by the user ' s defined ` State ` . This method can also be called when there are one or multiple ` Trans ` stored in the global ` EventChannel > ` . Such ` Trans ` will be passed to this method sequentially in the order of insertion .
pub fn transition(&mut self, request: Trans<T, E>, data: StateData<'_, T>) {
        if self.running {
            match request {
                Trans::None => (),
                Trans::Pop => self.pop(data),
                Trans::Push(state) => self.push(state, data),
                Trans::Switch(state) => self.switch(state, data),
                Trans::Replace(state) => self.replace(state, data),
                Trans::NewStack(states) => self.new_stack(states, data),
                Trans::Sequence(sequence) => {
                    for trans in sequence {
                        let temp_data = StateData {
                            context: data.context,
                            world: data.world,
                            data: data.data,
                        };
                        self.transition(trans, temp_data);
                    }
                }
                Trans::Quit => self.stop(data),
            }
        }
    }
pub fn transition ( & mut self , request : Trans < T , E > , data : StateData < ' _ , T > ) { if self . running { match request { Trans :: None => ( ) , Trans :: Pop => self . pop ( data ) , Trans :: Push ( state ) => self . push ( state , data ) , Trans :: Switch ( state ) => self . switch ( state , data ) , Trans :: Replace ( state ) => self . replace ( state , data ) , Trans :: NewStack ( states ) => self . new_stack ( states , data ) , Trans :: Sequence ( sequence ) => { for trans in sequence { let temp_data = StateData { context : data . context , world : data . world , data : data . data , } ; self . transition ( trans , temp_data ) ; } } Trans :: Quit => self . stop ( data ) , } } }
Performs a state transition.
Performs a state transition .
&mut self
request
Trans<T, E>
data
StateData<'_, T>
&mut self
request
Trans<T, E>
data
StateData<'_, T>