Project

General

Profile

« Previous | Next » 

Revision 473611ee

Added by Leszek Koltunski about 4 years ago

Progress with the 3x3x3 Solver.

View differences:

src/main/java/org/distorted/states/RubikState.java
21 21

  
22 22
import android.content.SharedPreferences;
23 23
import org.distorted.main.RubikActivity;
24
import static org.distorted.main.RubikSurfaceView.*;
24 25

  
25 26
///////////////////////////////////////////////////////////////////////////////////////////////////
26 27

  
27 28
public enum RubikState
28 29
  {
29
  MAIN ( null , false, new RubikStateMain()      ),
30
  PLAY ( MAIN , true , new RubikStatePlay()      ),
31
  SOLV ( PLAY , true , new RubikStateSolving()   ),
32
  PATT ( MAIN , false, new RubikStatePattern()   ),
33
  SVER ( MAIN , false, new RubikStateSolver()    ),
34
  SOLU ( SVER , false, new RubikStateSolution()  ),
30
  MAIN ( null , MODE_DRAG   , new RubikStateMain()     ),
31
  PLAY ( MAIN , MODE_ROTATE , new RubikStatePlay()     ),
32
  SOLV ( PLAY , MODE_ROTATE , new RubikStateSolving()  ),
33
  PATT ( MAIN , MODE_DRAG   , new RubikStatePattern()  ),
34
  SVER ( MAIN , MODE_REPLACE, new RubikStateSolver()   ),
35
  SOLU ( SVER , MODE_DRAG   , new RubikStateSolution() ),
35 36
  ;
36 37

  
37 38
  public static final int LENGTH = values().length;
38 39
  private final RubikState mBack;
39
  private boolean mCanRotate;
40
  private int mMode;
40 41
  private final RubikStateAbstract mClass;
41 42
  private static final RubikState[] sizes;
42 43

  
......
70 71

  
71 72
///////////////////////////////////////////////////////////////////////////////////////////////////
72 73

  
73
  public static boolean canRotate()
74
  public static int getMode()
74 75
    {
75
    return mCurrState.mCanRotate;
76
    return mCurrState.mMode;
76 77
    }
77 78

  
78 79
///////////////////////////////////////////////////////////////////////////////////////////////////
......
122 123

  
123 124
///////////////////////////////////////////////////////////////////////////////////////////////////
124 125

  
125
  RubikState(RubikState back, boolean canRotate, RubikStateAbstract clazz)
126
  RubikState(RubikState back, int mode, RubikStateAbstract clazz)
126 127
    {
127
    mBack      = back;
128
    mCanRotate = canRotate;
129
    mClass     = clazz;
128
    mBack = back;
129
    mMode = mode;
130
    mClass= clazz;
130 131
    }
131 132

  
132 133
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff