Project

General

Profile

« Previous | Next » 

Revision 9ba7f3f6

Added by Leszek Koltunski over 1 year ago

Move scrambling to a new model where there are spearete scrambling 'algorithms' and 'edges' of the scrambling graph.
Now each edge can contain a whole algorithm, i.e. a sequence of moves leading from state to state, which permits construction of scrambling for more complicated bandaged objects such as the AI cube.

Unchecked as of yet, probably still a lot of bugs.

View differences:

src/main/java/org/distorted/objectlib/objects/TwistyJing.java
21 21
import org.distorted.objectlib.helpers.ObjectFaceShape;
22 22
import org.distorted.objectlib.helpers.ObjectSignature;
23 23
import org.distorted.objectlib.helpers.ObjectVertexEffects;
24
import org.distorted.objectlib.scrambling.ScrambleEdgeGenerator;
24 25
import org.distorted.objectlib.main.InitData;
25 26
import org.distorted.objectlib.touchcontrol.TouchControlTetrahedron;
26 27
import org.distorted.objectlib.main.ObjectType;
27 28
import org.distorted.objectlib.helpers.ObjectShape;
28
import org.distorted.objectlib.scrambling.ScrambleState;
29 29
import org.distorted.objectlib.shape.ShapeTetrahedron;
30 30

  
31 31
///////////////////////////////////////////////////////////////////////////////////////////////////
......
44 44
                                 // Assuming the length of the edge of the whole
45 45
                                 // tetrahedron is 2.0 (ie standard, equal to numLayers)
46 46

  
47
  private ScrambleState[] mStates;
47
  private int[][] mEdges;
48 48
  private int[][] mBasicAngle;
49 49
  private int[] mQuatIndex;
50 50
  private float[][] mCuts;
......
67 67

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

  
70
  public ScrambleState[] getScrambleStates()
70
  public int[][] getScrambleEdges()
71 71
    {
72
    if( mStates==null )
73
      {
74
      int[] tmp = {0,-1,0, 0,1,0, 1,-1,0, 1,1,0 };
75

  
76
      mStates = new ScrambleState[]
77
        {
78
        new ScrambleState( new int[][] {tmp,tmp,tmp,tmp} )
79
        };
80
      }
81

  
82
    return mStates;
72
    if( mEdges==null ) mEdges = ScrambleEdgeGenerator.getScrambleEdgesSingle(mBasicAngle);
73
    return mEdges;
83 74
    }
84 75

  
85 76
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff