Revision 84adb9f4
Added by Leszek Koltunski 7 months ago
src/main/java/org/distorted/objectlib/metadata/ListObjects.java | ||
---|---|---|
175 | 175 |
return ordinal>=0 && ordinal<NUM_OBJECTS ? objects[ordinal] : CUBE_3; |
176 | 176 |
} |
177 | 177 |
|
178 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
179 |
|
|
180 |
public static int getObjectOrdinal(String upperName) |
|
181 |
{ |
|
182 |
for(int o=0; o<NUM_OBJECTS; o++) |
|
183 |
if( upperName.equals(objects[o].name()) ) return o; |
|
184 |
|
|
185 |
return -1; |
|
186 |
} |
|
187 |
|
|
178 | 188 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
179 | 189 |
|
180 | 190 |
public static int getObjectIndex(String upperName) |
src/main/java/org/distorted/objectlib/scrambling/ObjectScrambler.java | ||
---|---|---|
746 | 746 |
} |
747 | 747 |
|
748 | 748 |
ObjectMove algorithm = mAlgorithms[mCurrAlgorithm][mCurrStep]; |
749 |
scramble[curr].set(algorithm);
|
|
749 |
scramble[curr] = new ObjectMove(algorithm);
|
|
750 | 750 |
mAxisExcluded = algorithm.getAxis(); |
751 | 751 |
} |
752 | 752 |
|
src/main/java/org/distorted/objectlib/scrambling/ScrambleEdgeGenerator.java | ||
---|---|---|
145 | 145 |
int POS = N/2; |
146 | 146 |
int layerBmp = (1<<l); |
147 | 147 |
|
148 |
for(int k=NEG; k<=-1 ; k++, index++) ret[index][0].set(a,layerBmp,k);
|
|
149 |
for(int k=1 ; k<=POS; k++, index++) ret[index][0].set(a,layerBmp,k);
|
|
148 |
for(int k=NEG; k<=-1 ; k++, index++) ret[index][0] = new ObjectMove(a,layerBmp,k);
|
|
149 |
for(int k=1 ; k<=POS; k++, index++) ret[index][0] = new ObjectMove(a,layerBmp,k);
|
|
150 | 150 |
} |
151 | 151 |
} |
152 | 152 |
|
src/main/java/org/distorted/objectlib/solvers/tablebases/TBPyraminx.java | ||
---|---|---|
107 | 107 |
// specifically for the tablebase |
108 | 108 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
109 | 109 |
|
110 |
private void addMove(ObjectMove move, int axis, int twist)
|
|
110 |
private void addMove(ObjectMove[] move, int index, int axis, int twist)
|
|
111 | 111 |
{ |
112 |
move.set( axis, 4, (twist==2 ? -1:twist) );
|
|
112 |
move[index] = new ObjectMove( axis, 4, (twist==2 ? -1:twist) );
|
|
113 | 113 |
} |
114 | 114 |
|
115 | 115 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
212 | 212 |
ObjectMove[] extraMoves = new ObjectMove[lenExtra]; |
213 | 213 |
|
214 | 214 |
int index=0; |
215 |
if( extra[0]!=0 ) { addMove(extraMoves[index],1,extra[0]); index++; }
|
|
216 |
if( extra[1]!=0 ) { addMove(extraMoves[index],0,extra[1]); index++; }
|
|
217 |
if( extra[2]!=0 ) { addMove(extraMoves[index],3,extra[2]); index++; }
|
|
218 |
if( extra[3]!=0 ) { addMove(extraMoves[index],2,extra[3]); }
|
|
215 |
if( extra[0]!=0 ) { addMove(extraMoves,index,1,extra[0]); index++; }
|
|
216 |
if( extra[1]!=0 ) { addMove(extraMoves,index,0,extra[1]); index++; }
|
|
217 |
if( extra[2]!=0 ) { addMove(extraMoves,index,3,extra[2]); index++; }
|
|
218 |
if( extra[3]!=0 ) { addMove(extraMoves,index,2,extra[3]); }
|
|
219 | 219 |
|
220 | 220 |
int len = moves.length; |
221 | 221 |
int totalLen = len+lenExtra; |
src/main/java/org/distorted/objectlib/solvers/tablebases/TablebasesAbstract.java | ||
---|---|---|
441 | 441 |
for(int i=0; i<len; i++) |
442 | 442 |
{ |
443 | 443 |
int[] move = moves.get(i); |
444 |
ret[i].set(move[0],move[1],move[2]);
|
|
444 |
ret[i] = new ObjectMove(move[0],move[1],move[2]);
|
|
445 | 445 |
} |
446 | 446 |
|
447 | 447 |
return ret; |
Also available in: Unified diff
further fixes for crashers