/// Should be called whenever stage_progress is changed.
Should be called whenever stage_progress is changed.
Should be called whenever stage_progress is changed .
fn on_stage_progress_update(&mut self) {
        let stage_finished = STAGES
            .get(self.stage)
            .map(|x| {
                (x.msg_type == MessageType::Coin && self.coin_state.value().is_some())
                    || self.stage_progress >= x.msg_count
            })
            .unwrap_or(false);
        if stage_finished {
            self.stage += 1;
            self.stage_progress = 0;
            self.sent_stage_messages = false;
            self.on_stage_progress_update();
        }
    }
fn on_stage_progress_update ( & mut self ) { let stage_finished = STAGES . get ( self . stage ) . map ( | x | { ( x . msg_type == MessageType :: Coin && self . coin_state . value ( ) . is_some ( ) ) || self . stage_progress >= x . msg_count } ) . unwrap_or ( false ) ; if stage_finished { self . stage += 1 ; self . stage_progress = 0 ; self . sent_stage_messages = false ; self . on_stage_progress_update ( ) ; } }
Should be called whenever stage_progress is changed.
Should be called whenever stage_progress is changed .
&mut self