pub fn ensure(&mut self, flow: &EntityFlow) -> Option<&mut Self> {
        // current -> Some(<Exist>) | None
        if !self.current.map_or(false, |cur| flow.contains_node(&cur)) {
            self.clear_current();
        }
        // obj = Some(<Not Exist>) -> clean
        // obj = None | Some(<Exist>) -> keep
        if self.is_valid_cube(flow) {
            Some(self)
        } else {
            None
        }
    }
/// fix a cube to a legal state if it's not already.
fix a cube to a legal state if it's not already.
fix a cube to a legal state if it ' s not already .
pub fn ensure(&mut self, flow: &EntityFlow) -> Option<&mut Self> {
        // current -> Some(<Exist>) | None
        if !self.current.map_or(false, |cur| flow.contains_node(&cur)) {
            self.clear_current();
        }
        // obj = Some(<Not Exist>) -> clean
        // obj = None | Some(<Exist>) -> keep
        if self.is_valid_cube(flow) {
            Some(self)
        } else {
            None
        }
    }
pub fn ensure ( & mut self , flow : & EntityFlow ) -> Option < & mut Self > { // current -> Some(<Exist>) | None if ! self . current . map_or ( false , | cur | flow . contains_node ( & cur ) ) { self . clear_current ( ) ; } // obj = Some(<Not Exist>) -> clean // obj = None | Some(<Exist>) -> keep if self . is_valid_cube ( flow ) { Some ( self ) } else { None } }
fix a cube to a legal state if it's not already.
fix a cube to a legal state if it ' s not already .
&mut self
flow
&EntityFlow
&mut self
flow
&EntityFlow