Exemplo n.º 1
0
        public void rotate(Rotation p_rotation)
        {
            Face      l_temp;
            Face      l_face      = p_rotation.getFace();
            Direction l_direction = p_rotation.getDirection();

            if (l_face == Face.TOP)
            {
                if (l_direction == Direction.CW)
                {
                    c_currentFront = getFace(Face.RIGHT);
                }
                else
                {
                    c_currentFront = getFace(Face.LEFT);
                }
            }
            else if (l_face == Face.RIGHT)
            {
                if (l_direction == Direction.CW)
                {
                    l_temp         = c_currentFront;
                    c_currentFront = getFace(Face.BOTTOM);
                    c_currentUp    = l_temp;
                }
                else
                {
                    l_temp         = getFace(Face.BACK);
                    c_currentFront = c_currentUp;
                    c_currentUp    = l_temp;
                }
            }
            else if (l_face == Face.FRONT)
            {
                if (l_direction == Direction.CW)
                {
                    c_currentUp = getFace(Face.LEFT);
                }
                else
                {
                    c_currentUp = getFace(Face.RIGHT);
                }
            }
            else
            {
                rotate(new Rotation(FaceHandler.getOpposite(l_face), DirectionHandler.getOpposite(l_direction)));
            }
        }
Exemplo n.º 2
0
 public Rotation getReverse()
 {
     return(new Rotation(c_face, DirectionHandler.getOpposite(c_direction)));
 }