Project

General

Profile

« Previous | Next » 

Revision f9a81f52

Added by Leszek Koltunski over 2 years ago

Progress with serializing object to JSON: scrambling.

View differences:

src/main/java/org/distorted/objectlib/helpers/ScrambleState.java
29 29
  private final int[] mNum;
30 30
  private final int[] mInfo;
31 31
  private final int[] mTmp;
32
  private final int[][] mOrigAxis;
32 33
  private final int LEN = 4;
33 34

  
34 35
///////////////////////////////////////////////////////////////////////////////////////////////////
35 36

  
36 37
  public ScrambleState(int[][] axis)
37 38
    {
39
    mOrigAxis = axis;
40

  
38 41
    mTmp = new int[LEN];
39 42

  
40 43
    mNumAxis = axis.length;
......
137 140
    return mTmp;
138 141
    }
139 142

  
143
///////////////////////////////////////////////////////////////////////////////////////////////////
144

  
145
  public int getNumAxis()
146
    {
147
    return mNumAxis;
148
    }
149

  
150
///////////////////////////////////////////////////////////////////////////////////////////////////
151

  
152
  public int[] getAx(int numAx)
153
    {
154
    return (numAx>=0 && numAx<mNumAxis) ? mOrigAxis[numAx] : null;
155
    }
156

  
140 157
///////////////////////////////////////////////////////////////////////////////////////////////////
141 158

  
142 159
  public int getTotal(int indexExcluded)
src/main/java/org/distorted/objectlib/main/Movement.java
34 34
  // each face is split into several parts by lines coming from its center to the vertices
35 35
  public static final int TYPE_SPLIT_CORNER = 2;
36 36

  
37
  public static final int MOVEMENT_HEXAHEDRON   = 0;
38
  public static final int MOVEMENT_TETRAHEDRON  = 1;
39
  public static final int MOVEMENT_OCTAHEDRON   = 2;
40
  public static final int MOVEMENT_DODECAHEDRON = 3;
41
  public static final int MOVEMENT_SHAPECHANGE  = 4;
37
  public static final int MOVEMENT_HEXAHEDRON   = 6;
38
  public static final int MOVEMENT_TETRAHEDRON  = 4;
39
  public static final int MOVEMENT_OCTAHEDRON   = 8;
40
  public static final int MOVEMENT_DODECAHEDRON =12;
41
  public static final int MOVEMENT_SHAPECHANGE  = 0;
42 42

  
43 43
  static final float SQ3 = (float)Math.sqrt(3);
44 44
  static final float SQ6 = (float)Math.sqrt(6);
src/main/java/org/distorted/objectlib/main/TwistyObject.java
739 739

  
740 740
///////////////////////////////////////////////////////////////////////////////////////////////////
741 741

  
742
  protected int getScrambleType()
742
  public int getScrambleType()
743 743
    {
744 744
    return 0;
745 745
    }
......
1389 1389
  protected abstract Static4D getQuat(int cubit, int[] numLayers);
1390 1390
  protected abstract ObjectShape getObjectShape(int cubit, int[] numLayers);
1391 1391
  protected abstract int[] getSolvedQuats(int cubit, int[] numLayers);
1392
  protected abstract ScrambleState[] getScrambleStates();
1393 1392
  protected abstract int getNumStickerTypes(int[] numLayers);
1394 1393
  protected abstract ObjectSticker retSticker(int face);
1395 1394
  protected abstract int getFaceColor(int cubit, int cubitface, int[] numLayers);
......
1403 1402
  public abstract boolean[][] getLayerRotatable(int[] numLayers);
1404 1403
  public abstract int[][][] getEnabled();
1405 1404
  public abstract float[] getDist3D(int[] numLayers);
1405
  public abstract ScrambleState[] getScrambleStates();
1406 1406

  
1407 1407
  public abstract Static3D[] getRotationAxis();
1408 1408
  public abstract int[] getBasicAngle();
src/main/java/org/distorted/objectlib/objects/TwistyBandaged2Bar.java
43 43

  
44 44
///////////////////////////////////////////////////////////////////////////////////////////////////
45 45

  
46
  protected ScrambleState[] getScrambleStates()
46
  public ScrambleState[] getScrambleStates()
47 47
    {
48 48
    if( mStates==null )
49 49
      {
src/main/java/org/distorted/objectlib/objects/TwistyBandaged3Plate.java
43 43

  
44 44
///////////////////////////////////////////////////////////////////////////////////////////////////
45 45

  
46
  protected ScrambleState[] getScrambleStates()
46
  public ScrambleState[] getScrambleStates()
47 47
    {
48 48
    if( mStates==null )
49 49
      {
src/main/java/org/distorted/objectlib/objects/TwistyBandagedEvil.java
43 43

  
44 44
///////////////////////////////////////////////////////////////////////////////////////////////////
45 45

  
46
  protected ScrambleState[] getScrambleStates()
46
  public ScrambleState[] getScrambleStates()
47 47
    {
48 48
    if( mStates==null )
49 49
      {
src/main/java/org/distorted/objectlib/objects/TwistyBandagedFused.java
43 43

  
44 44
///////////////////////////////////////////////////////////////////////////////////////////////////
45 45

  
46
  protected ScrambleState[] getScrambleStates()
46
  public ScrambleState[] getScrambleStates()
47 47
    {
48 48
    if( mStates==null )
49 49
      {
src/main/java/org/distorted/objectlib/objects/TwistyCuboid.java
109 109

  
110 110
///////////////////////////////////////////////////////////////////////////////////////////////////
111 111

  
112
  protected ScrambleState[] getScrambleStates()
112
  public ScrambleState[] getScrambleStates()
113 113
    {
114 114
    if( mStates==null )
115 115
      {
src/main/java/org/distorted/objectlib/objects/TwistyDiamond.java
70 70

  
71 71
///////////////////////////////////////////////////////////////////////////////////////////////////
72 72

  
73
  protected ScrambleState[] getScrambleStates()
73
  public ScrambleState[] getScrambleStates()
74 74
    {
75 75
    if( mStates==null )
76 76
      {
src/main/java/org/distorted/objectlib/objects/TwistyDino4.java
47 47

  
48 48
///////////////////////////////////////////////////////////////////////////////////////////////////
49 49

  
50
  protected ScrambleState[] getScrambleStates()
50
  public ScrambleState[] getScrambleStates()
51 51
    {
52 52
    if( mStates==null )
53 53
      {
src/main/java/org/distorted/objectlib/objects/TwistyDino6.java
47 47

  
48 48
///////////////////////////////////////////////////////////////////////////////////////////////////
49 49

  
50
  protected ScrambleState[] getScrambleStates()
50
  public ScrambleState[] getScrambleStates()
51 51
    {
52 52
    if( mStates==null )
53 53
      {
src/main/java/org/distorted/objectlib/objects/TwistyHelicopter.java
73 73

  
74 74
///////////////////////////////////////////////////////////////////////////////////////////////////
75 75

  
76
  protected ScrambleState[] getScrambleStates()
76
  public ScrambleState[] getScrambleStates()
77 77
    {
78 78
    if( mStates==null )
79 79
      {
src/main/java/org/distorted/objectlib/objects/TwistyIvy.java
72 72

  
73 73
///////////////////////////////////////////////////////////////////////////////////////////////////
74 74

  
75
  protected ScrambleState[] getScrambleStates()
75
  public ScrambleState[] getScrambleStates()
76 76
    {
77 77
    if( mStates==null )
78 78
      {
src/main/java/org/distorted/objectlib/objects/TwistyJing.java
74 74

  
75 75
///////////////////////////////////////////////////////////////////////////////////////////////////
76 76

  
77
  protected ScrambleState[] getScrambleStates()
77
  public ScrambleState[] getScrambleStates()
78 78
    {
79 79
    if( mStates==null )
80 80
      {
src/main/java/org/distorted/objectlib/objects/TwistyMinx.java
86 86

  
87 87
///////////////////////////////////////////////////////////////////////////////////////////////////
88 88

  
89
  protected ScrambleState[] getScrambleStates()
89
  public ScrambleState[] getScrambleStates()
90 90
    {
91 91
    if( mStates==null )
92 92
      {
src/main/java/org/distorted/objectlib/objects/TwistyMirror.java
87 87

  
88 88
///////////////////////////////////////////////////////////////////////////////////////////////////
89 89

  
90
  protected ScrambleState[] getScrambleStates()
90
  public ScrambleState[] getScrambleStates()
91 91
    {
92 92
    if( mStates==null )
93 93
      {
src/main/java/org/distorted/objectlib/objects/TwistyPyraminx.java
67 67

  
68 68
///////////////////////////////////////////////////////////////////////////////////////////////////
69 69

  
70
  protected ScrambleState[] getScrambleStates()
70
  public ScrambleState[] getScrambleStates()
71 71
    {
72 72
    if( mStates==null )
73 73
      {
src/main/java/org/distorted/objectlib/objects/TwistyRedi.java
69 69

  
70 70
///////////////////////////////////////////////////////////////////////////////////////////////////
71 71

  
72
  protected ScrambleState[] getScrambleStates()
72
  public ScrambleState[] getScrambleStates()
73 73
    {
74 74
    if( mStates==null )
75 75
      {
src/main/java/org/distorted/objectlib/objects/TwistyRex.java
70 70

  
71 71
///////////////////////////////////////////////////////////////////////////////////////////////////
72 72

  
73
  protected ScrambleState[] getScrambleStates()
73
  public ScrambleState[] getScrambleStates()
74 74
    {
75 75
    if( mStates==null )
76 76
      {
src/main/java/org/distorted/objectlib/objects/TwistySkewb.java
68 68

  
69 69
///////////////////////////////////////////////////////////////////////////////////////////////////
70 70

  
71
  protected ScrambleState[] getScrambleStates()
71
  public ScrambleState[] getScrambleStates()
72 72
    {
73 73
    if( mStates==null )
74 74
      {
src/main/java/org/distorted/objectlib/objects/TwistySquare1.java
57 57

  
58 58
///////////////////////////////////////////////////////////////////////////////////////////////////
59 59

  
60
  protected ScrambleState[] getScrambleStates()
60
  public ScrambleState[] getScrambleStates()
61 61
    {
62 62
    return null;
63 63
    }
......
71 71

  
72 72
///////////////////////////////////////////////////////////////////////////////////////////////////
73 73

  
74
  protected int getScrambleType()
74
  public int getScrambleType()
75 75
    {
76 76
    return 1;
77 77
    }
src/main/java/org/distorted/objectlib/objects/TwistySquare2.java
57 57

  
58 58
///////////////////////////////////////////////////////////////////////////////////////////////////
59 59

  
60
  protected ScrambleState[] getScrambleStates()
60
  public ScrambleState[] getScrambleStates()
61 61
    {
62 62
    if( mStates==null )
63 63
      {
src/main/java/org/distorted/objectlib/objects/TwistyUltimate.java
78 78

  
79 79
///////////////////////////////////////////////////////////////////////////////////////////////////
80 80

  
81
  protected ScrambleState[] getScrambleStates()
81
  public ScrambleState[] getScrambleStates()
82 82
    {
83 83
    if( mStates==null )
84 84
      {

Also available in: Unified diff