pub fn step(
        &mut self,
        self_ref: Option<&URef<Space>>,
        tick: Tick,
    ) -> (SpaceStepInfo, UniverseTransaction) {
        // Process changed block definitions.
        for block_index in self.todo.borrow_mut().blocks.drain() {
            self.notifier.notify(SpaceChange::BlockValue(block_index));
            let data: &mut SpaceBlockData = &mut self.block_data[usize::from(block_index)];
            // TODO: handle error by switching to a "broken block" state.
            // We may want to have a higher-level error handling by pausing the world
            // and giving the user choices like reverting to save, editing to fix, or
            // continuing with a partly broken world.
            data.evaluated = data.block.evaluate().expect("block reevaluation failed");
            // TODO: Process side effects on individual cubes such as reevaluating the
            // lighting influenced by the block.
        }

        let mut transaction = UniverseTransaction::default();
        if let Some(self_ref) = self_ref {
            if !tick.paused() {
                transaction = self.behaviors.step(
                    &*self,
                    &(|t: SpaceTransaction| t.bind(self_ref.clone())),
                    SpaceTransaction::behaviors,
                    tick,
                );
            }
        }

        let light = self.update_lighting_from_queue();

        (SpaceStepInfo { spaces: 1, light }, transaction)
    }
/// Advance time in the space.
Advance time in the space.
Advance time in the space .
pub fn step(
        &mut self,
        self_ref: Option<&URef<Space>>,
        tick: Tick,
    ) -> (SpaceStepInfo, UniverseTransaction) {
        // Process changed block definitions.
        for block_index in self.todo.borrow_mut().blocks.drain() {
            self.notifier.notify(SpaceChange::BlockValue(block_index));
            let data: &mut SpaceBlockData = &mut self.block_data[usize::from(block_index)];
            // TODO: handle error by switching to a "broken block" state.
            // We may want to have a higher-level error handling by pausing the world
            // and giving the user choices like reverting to save, editing to fix, or
            // continuing with a partly broken world.
            data.evaluated = data.block.evaluate().expect("block reevaluation failed");
            // TODO: Process side effects on individual cubes such as reevaluating the
            // lighting influenced by the block.
        }
        let mut transaction = UniverseTransaction::default();
        if let Some(self_ref) = self_ref {
            if !tick.paused() {
                transaction = self.behaviors.step(
                    &*self,
                    &(|t: SpaceTransaction| t.bind(self_ref.clone())),
                    SpaceTransaction::behaviors,
                    tick,
                );
            }
        }
        let light = self.update_lighting_from_queue();
        (SpaceStepInfo { spaces: 1, light }, transaction)
    }
pub fn step ( & mut self , self_ref : Option < & URef < Space > > , tick : Tick , ) -> ( SpaceStepInfo , UniverseTransaction ) { // Process changed block definitions. for block_index in self . todo . borrow_mut ( ) . blocks . drain ( ) { self . notifier . notify ( SpaceChange :: BlockValue ( block_index ) ) ; let data : & mut SpaceBlockData = & mut self . block_data [ usize :: from ( block_index ) ] ; // TODO: handle error by switching to a "broken block" state. // We may want to have a higher-level error handling by pausing the world // and giving the user choices like reverting to save, editing to fix, or // continuing with a partly broken world. data . evaluated = data . block . evaluate ( ) . expect ( " " ) ; // TODO: Process side effects on individual cubes such as reevaluating the // lighting influenced by the block. } let mut transaction = UniverseTransaction :: default ( ) ; if let Some ( self_ref ) = self_ref { if ! tick . paused ( ) { transaction = self . behaviors . step ( & * self , & ( | t : SpaceTransaction | t . bind ( self_ref . clone ( ) ) ) , SpaceTransaction :: behaviors , tick , ) ; } } let light = self . update_lighting_from_queue ( ) ; ( SpaceStepInfo { spaces : 1 , light } , transaction ) }
Advance time in the space.
Advance time in the space .
&mut self
self_ref
Option<&URef<Space>>
tick
Tick