Пример #1
0
 private void rotate(Rotation p_rotation
                     , CubeCubicle cubicle1
                     , CubeCubicle cubicle2
                     , CubeCubicle cubicle3
                     , CubeCubicle cubicle4)
 {
     if (p_rotation.getDirection() == Direction.CW)
     {
         CubeCubicle tmpCubicle = new CubeCubicle(
             cubicle4.getLocation(), cubicle4.currentCubieOriginalLocation(), cubicle4.getCubiePosition());
         cubicle4.rotateFrom(p_rotation, cubicle3);
         cubicle3.rotateFrom(p_rotation, cubicle2);
         cubicle2.rotateFrom(p_rotation, cubicle1);
         cubicle1.rotateFrom(p_rotation, tmpCubicle);
     }
     else
     {
         CubeCubicle tmpCubicle = new CubeCubicle(
             cubicle1.getLocation(), cubicle1.currentCubieOriginalLocation(), cubicle1.getCubiePosition());
         cubicle1.rotateFrom(p_rotation, cubicle2);
         cubicle2.rotateFrom(p_rotation, cubicle3);
         cubicle3.rotateFrom(p_rotation, cubicle4);
         cubicle4.rotateFrom(p_rotation, tmpCubicle);
     }
 }
Пример #2
0
 private void initializeCubeCubicles()
 {
     cubeCubicles[0]  = new CubeCubicle(new Location(Face.F, Face.U), new Location(Face.F, Face.U), new Position(Face.U, Face.F));
     cubeCubicles[1]  = new CubeCubicle(new Location(Face.F, Face.R), new Location(Face.F, Face.R), new Position(Face.U, Face.F));
     cubeCubicles[2]  = new CubeCubicle(new Location(Face.F, Face.L), new Location(Face.F, Face.L), new Position(Face.U, Face.F));
     cubeCubicles[3]  = new CubeCubicle(new Location(Face.F, Face.D), new Location(Face.F, Face.D), new Position(Face.U, Face.F));
     cubeCubicles[4]  = new CubeCubicle(new Location(Face.B, Face.U), new Location(Face.B, Face.U), new Position(Face.U, Face.F));
     cubeCubicles[5]  = new CubeCubicle(new Location(Face.B, Face.R), new Location(Face.B, Face.R), new Position(Face.U, Face.F));
     cubeCubicles[6]  = new CubeCubicle(new Location(Face.B, Face.L), new Location(Face.B, Face.L), new Position(Face.U, Face.F));
     cubeCubicles[7]  = new CubeCubicle(new Location(Face.B, Face.D), new Location(Face.B, Face.D), new Position(Face.U, Face.F));
     cubeCubicles[8]  = new CubeCubicle(new Location(Face.U, Face.R), new Location(Face.U, Face.R), new Position(Face.U, Face.F));
     cubeCubicles[9]  = new CubeCubicle(new Location(Face.U, Face.L), new Location(Face.U, Face.L), new Position(Face.U, Face.F));
     cubeCubicles[10] = new CubeCubicle(new Location(Face.D, Face.R), new Location(Face.D, Face.R), new Position(Face.U, Face.F));
     cubeCubicles[11] = new CubeCubicle(new Location(Face.D, Face.L), new Location(Face.D, Face.L), new Position(Face.U, Face.F));
     cubeCubicles[12] = new CubeCubicle(new Location(Face.F, Face.U, Face.R), new Location(Face.F, Face.U, Face.R), new Position(Face.U, Face.F));
     cubeCubicles[13] = new CubeCubicle(new Location(Face.F, Face.U, Face.L), new Location(Face.F, Face.U, Face.L), new Position(Face.U, Face.F));
     cubeCubicles[14] = new CubeCubicle(new Location(Face.F, Face.D, Face.R), new Location(Face.F, Face.D, Face.R), new Position(Face.U, Face.F));
     cubeCubicles[15] = new CubeCubicle(new Location(Face.F, Face.D, Face.L), new Location(Face.F, Face.D, Face.L), new Position(Face.U, Face.F));
     cubeCubicles[16] = new CubeCubicle(new Location(Face.B, Face.U, Face.R), new Location(Face.B, Face.U, Face.R), new Position(Face.U, Face.F));
     cubeCubicles[17] = new CubeCubicle(new Location(Face.B, Face.U, Face.L), new Location(Face.B, Face.U, Face.L), new Position(Face.U, Face.F));
     cubeCubicles[18] = new CubeCubicle(new Location(Face.B, Face.D, Face.R), new Location(Face.B, Face.D, Face.R), new Position(Face.U, Face.F));
     cubeCubicles[19] = new CubeCubicle(new Location(Face.B, Face.D, Face.L), new Location(Face.B, Face.D, Face.L), new Position(Face.U, Face.F));
 }
Пример #3
0
 public void addCubicleData(CubeCubicle p_cubicleData)
 {
     c_cubicles++;
     c_Cube_cubicle[c_cubicles] = p_cubicleData;
 }