pub fn maybe_step_universe(&mut self) -> Option<UniverseStepInfo> {
        let mut result = None;
        // TODO: Catch-up implementation should probably live in FrameClock.
        for _ in 0..FrameClock::CATCH_UP_STEPS {
            if self.frame_clock.should_step() {
                let mut tick = self.frame_clock.tick();
                if *self.paused.get() {
                    tick = tick.pause();
                }
                self.frame_clock.did_step();

                if let Some(character_ref) = &self.game_character {
                    self.input_processor.apply_input(
                        &mut character_ref.borrow_mut(),
                        &self.paused,
                        tick,
                    );
                }
                self.input_processor.step(tick);

                let mut info = self.game_universe.step(tick);

                self.maybe_sync_ui();
                info += self.ui.step(tick);

                self.last_step_info = info.clone();
                result = Some(info)
            }
        }
        result
    }
/// Steps the universe if the `FrameClock` says it's time to do so.
/// Always returns info for the last step even if multiple steps were taken.
Steps the universe if the `FrameClock` says it's time to do so.
Always returns info for the last step even if multiple steps were taken.
Steps the universe if the ` FrameClock ` says it ' s time to do so . Always returns info for the last step even if multiple steps were taken .
pub fn maybe_step_universe(&mut self) -> Option<UniverseStepInfo> {
        let mut result = None;
        // TODO: Catch-up implementation should probably live in FrameClock.
        for _ in 0..FrameClock::CATCH_UP_STEPS {
            if self.frame_clock.should_step() {
                let mut tick = self.frame_clock.tick();
                if *self.paused.get() {
                    tick = tick.pause();
                }
                self.frame_clock.did_step();
                if let Some(character_ref) = &self.game_character {
                    self.input_processor.apply_input(
                        &mut character_ref.borrow_mut(),
                        &self.paused,
                        tick,
                    );
                }
                self.input_processor.step(tick);
                let mut info = self.game_universe.step(tick);
                self.maybe_sync_ui();
                info += self.ui.step(tick);
                self.last_step_info = info.clone();
                result = Some(info)
            }
        }
        result
    }
pub fn maybe_step_universe ( & mut self ) -> Option < UniverseStepInfo > { let mut result = None ; // TODO: Catch-up implementation should probably live in FrameClock. for _ in 0 .. FrameClock :: CATCH_UP_STEPS { if self . frame_clock . should_step ( ) { let mut tick = self . frame_clock . tick ( ) ; if * self . paused . get ( ) { tick = tick . pause ( ) ; } self . frame_clock . did_step ( ) ; if let Some ( character_ref ) = & self . game_character { self . input_processor . apply_input ( & mut character_ref . borrow_mut ( ) , & self . paused , tick , ) ; } self . input_processor . step ( tick ) ; let mut info = self . game_universe . step ( tick ) ; self . maybe_sync_ui ( ) ; info += self . ui . step ( tick ) ; self . last_step_info = info . clone ( ) ; result = Some ( info ) } } result }
Steps the universe if the `FrameClock` says it's time to do so.
Steps the universe if the ` FrameClock ` says it ' s time to do so .
&mut self