Project

General

Profile

« Previous | Next » 

Revision d2d4316a

Added by Leszek Koltunski 11 days ago

Seriously re-structure the architecture in preparation for different types of Phases (PhaseRegex!)

View differences:

src/main/java/org/distorted/phasedsolver/SolverActivity.java
21 21

  
22 22
import org.distorted.library.main.DistortedLibrary;
23 23
import org.distorted.library.type.Static3D;
24
import org.distorted.objectlib.algsolvers.PhasedSolver;
25
import org.distorted.objectlib.algsolvers.SolvedObject;
24
import org.distorted.objectlib.algphases.Phase;
25
import org.distorted.objectlib.algphases.PhaseCyclicOrie1;
26
import org.distorted.objectlib.algphases.PhaseCyclicPerm1;
27
import org.distorted.objectlib.algphases.PhaseCyclicPerm2;
28
import org.distorted.objectlib.algphases.PhaseNotCyclic;
29
import org.distorted.objectlib.algsolvers.*;
26 30
import org.distorted.objectlib.main.InitAssets;
27 31
import org.distorted.objectlib.main.ObjectControl;
28 32
import org.distorted.objectlib.main.TwistyObject;
......
183 187

  
184 188
      int[][] moves = so.getMoveTable();
185 189

  
186
      int[][][] params = {
187
                           { {12,13,16,17}      },   // white cross - all at once
188
                           { {0}, {1}, {2}, {3} },   // white corners - one by one
189
                           { {8}, {9},{10},{11} },   // 2nd layer edges - one by one
190
                           { {14,1} },               // cyclic (cubit,quatIndex) - yellow cross
191
                           { { 4,1} }                // cyclic (cubit,quatIndex) - yellow corners
192
                         };
193
      int[] modes  = {
194
                       PhasedSolver.MODE_NOT_CYCLIC,
195
                       PhasedSolver.MODE_NOT_CYCLIC,
196
                       PhasedSolver.MODE_NOT_CYCLIC,
197
                       PhasedSolver.MODE_CYCLIC_O_FIRST,
198
                       PhasedSolver.MODE_CYCLIC_P_FIRST
199
                     };
200

  
201
      PhasedSolver ps = new PhasedSolver(so,params,modes);
190
      int[][] whiteCross   = new int[][]{ {12,13,16,17} };
191
      int[][] whiteCorners = new int[][]{ {0},{1},{2},{3} };
192
      int[][] secondLayer  = new int[][]{ {8},{9},{10},{11} };
193
      int yellowCrossCubit = 14;
194
      int yellowCrossQuat  = 1;
195
      int yellowCornerCubit= 4;
196
      int yellowCornerQuat = 1;
197

  
198
      Phase[] phases =
199
              {
200
                new PhaseNotCyclic( whiteCross),
201
                new PhaseNotCyclic( whiteCorners),
202
                new PhaseNotCyclic( secondLayer),
203
                new PhaseCyclicOrie1( so, yellowCrossCubit , yellowCrossQuat ),
204
                new PhaseCyclicPerm2( so, yellowCrossCubit , yellowCrossQuat ),
205
                new PhaseCyclicPerm1( so, yellowCornerCubit, yellowCornerQuat ),
206
              };
207

  
208
      PhasedSolver ps = new PhasedSolver(so,phases);
202 209

  
203 210
      runOnUiThread(new Runnable()
204 211
        {

Also available in: Unified diff