예제 #1
0
 public Rotation(int p_value)
 {
     if (p_value > 5)
     {
         c_direction = DirectionFactory.getDirectionByInt(1);
         c_face      = FaceFactory.getFaceByInt(p_value - 6);
     }
     else
     {
         c_direction = DirectionFactory.getDirectionByInt(0);
         c_face      = FaceFactory.getFaceByInt(p_value);
     }
 }
예제 #2
0
        public bool readFromFile(RubikFileReader p_reader)
        {
            int l_int;

            l_int = p_reader.read();
            while ((l_int == ' ') || (l_int == 10))
            {
                l_int = p_reader.read();
            }
            if ((l_int == '\n') || (l_int == -1 /*EOF*/) || (l_int != '('))
            {
                return(false);
            }
            else
            {
                c_face = FaceFactory.getFaceByInt((int)Char.GetNumericValue((char)(p_reader.read())));
                p_reader.read();
                c_direction = DirectionFactory.getDirectionByInt((int)Char.GetNumericValue((char)(p_reader.read())));
                p_reader.read();
                return(true);
            }
        }