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/TwistyPyraminxDiamond.java
19 19
import org.distorted.objectlib.helpers.ObjectShape;
20 20
import org.distorted.objectlib.helpers.ObjectSignature;
21 21
import org.distorted.objectlib.helpers.ObjectVertexEffects;
22
import org.distorted.objectlib.scrambling.ScrambleEdgeGenerator;
22 23
import org.distorted.objectlib.main.InitData;
23 24
import org.distorted.objectlib.main.ObjectType;
24
import org.distorted.objectlib.scrambling.ScrambleState;
25 25
import org.distorted.objectlib.shape.ShapeOctahedron;
26 26
import org.distorted.objectlib.touchcontrol.TouchControlOctahedron;
27 27

  
......
41 41
  private static final float D = 0.3f;  // Size of the small cubit in relation to the face of the octahedron.
42 42
                                        // Keep below 1/3.
43 43

  
44
  private ScrambleState[] mStates;
44
  private int[][] mEdges;
45 45
  private int[][] mBasicAngle;
46 46
  private float[][] mCuts;
47 47
  private float[][] mPositions;
......
56 56

  
57 57
///////////////////////////////////////////////////////////////////////////////////////////////////
58 58

  
59
  public ScrambleState[] getScrambleStates()
59
  public int[][] getScrambleEdges()
60 60
    {
61
    if( mStates==null )
62
      {
63
      int[] m = new int[] { 0,-1,0,0,1,0,0,2,0, 2,-1,0,2,1,0,2,2,0};
64

  
65
      mStates = new ScrambleState[]
66
          {
67
          new ScrambleState( new int[][] { m, m, m } )
68
          };
69
      }
70

  
71
    return mStates;
61
    if( mEdges==null ) mEdges = ScrambleEdgeGenerator.getScrambleEdgesSingle(mBasicAngle);
62
    return mEdges;
72 63
    }
73 64

  
74 65
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff