Project

General

Profile

« Previous | Next » 

Revision a57e6870

Added by Leszek Koltunski over 2 years ago

make numLayers into an int[] (preparation for Cuboids)
Caution: because of previous changes to cubit order in cube, the Solver is broken!

View differences:

src/main/java/org/distorted/objectlib/main/TwistyObjectScrambler.java
30 30
  private final ScrambleState[] mStates;
31 31
  private final int mType;
32 32
  private final int mNumAxis;
33
  private final int mNumLayers;
33
  private final int[] mNumLayers;
34 34

  
35 35
  // type=0, i.e. main
36 36
  private int mCurrState;
......
54 54

  
55 55
///////////////////////////////////////////////////////////////////////////////////////////////////
56 56

  
57
  TwistyObjectScrambler(int type, int numAxis, int numLayers, ScrambleState[] states)
57
  TwistyObjectScrambler(int type, int numAxis, int[] numLayers, ScrambleState[] states)
58 58
    {
59 59
    mType = type;
60 60
    mNumAxis = numAxis;
......
109 109
    {
110 110
    if( mScrambleTable ==null )
111 111
      {
112
      mScrambleTable = new int[mNumAxis][mNumLayers];
112
      mScrambleTable = new int[mNumAxis][];
113 113
      }
114 114
    if( mNumOccurences ==null )
115 115
      {
......
125 125
      }
126 126

  
127 127
    for(int i=0; i<mNumAxis; i++)
128
      for(int j=0; j<mNumLayers; j++) mScrambleTable[i][j] = 0;
128
      {
129
      int len = mNumLayers[i];
130
      mScrambleTable[i] = new int[len];
131
      for(int j=0; j<len; j++) mScrambleTable[i][j] = 0;
132
      }
129 133
    }
130 134

  
131 135
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff