pub fn as_faces(&self) -> Cube2x2x2Faces {
        let mut faces = Cube2x2x2Faces::new();

        // Translate corner pieces into face colors
        for corner_idx in 0..8 {
            let piece = self.corners[corner_idx];
            for i in 0..3 {
                let dest = crate::tables::corner::CUBE2_CORNER_INDICIES[corner_idx][i];
                let src = crate::tables::corner::CUBE2_CORNER_INDICIES[piece.piece as u8 as usize]
                    [(i + 3 - piece.orientation as usize) % 3];
                let face = Cube2x2x2Faces::face_for_idx(src);
                faces.state[dest] = face.color();
            }
        }

        faces
    }
/// Gets this cube state in face color format
Gets this cube state in face color format
Gets this cube state in face color format
pub fn as_faces(&self) -> Cube2x2x2Faces {
        let mut faces = Cube2x2x2Faces::new();
        // Translate corner pieces into face colors
        for corner_idx in 0..8 {
            let piece = self.corners[corner_idx];
            for i in 0..3 {
                let dest = crate::tables::corner::CUBE2_CORNER_INDICIES[corner_idx][i];
                let src = crate::tables::corner::CUBE2_CORNER_INDICIES[piece.piece as u8 as usize]
                    [(i + 3 - piece.orientation as usize) % 3];
                let face = Cube2x2x2Faces::face_for_idx(src);
                faces.state[dest] = face.color();
            }
        }
        faces
    }
pub fn as_faces ( & self ) -> Cube2x2x2Faces { let mut faces = Cube2x2x2Faces :: new ( ) ; // Translate corner pieces into face colors for corner_idx in 0 .. 8 { let piece = self . corners [ corner_idx ] ; for i in 0 .. 3 { let dest = crate :: tables :: corner :: CUBE2_CORNER_INDICIES [ corner_idx ] [ i ] ; let src = crate :: tables :: corner :: CUBE2_CORNER_INDICIES [ piece . piece as u8 as usize ] [ ( i + 3 - piece . orientation as usize ) % 3 ] ; let face = Cube2x2x2Faces :: face_for_idx ( src ) ; faces . state [ dest ] = face . color ( ) ; } } faces }
Gets this cube state in face color format
Gets this cube state in face color format
&self
&self