Revision 967c1d17
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/objects/TwistyJing.java | ||
---|---|---|
19 | 19 |
|
20 | 20 |
package org.distorted.objects; |
21 | 21 |
|
22 |
import static org.distorted.objects.Movement.TYPE_NOT_SPLIT; |
|
23 |
|
|
22 | 24 |
import android.content.res.Resources; |
23 | 25 |
|
24 | 26 |
import org.distorted.helpers.ObjectShape; |
... | ... | |
43 | 45 |
new Static3D(-SQ6/3,+SQ3/3, 0), |
44 | 46 |
}; |
45 | 47 |
|
48 |
private static final int[] NUM_ENABLED = {3,3,3,3}; |
|
49 |
|
|
50 |
private static final int[][][] ENABLED = new int[][][] |
|
51 |
{ |
|
52 |
{{1,2,3}},{{0,2,3}},{{0,1,3}},{{0,1,2}} |
|
53 |
}; |
|
54 |
|
|
46 | 55 |
static final float F = 0.48f; // length of the edge of the corner cubit. Keep<0.5 |
47 | 56 |
// Assuming the length of the edge of the whole |
48 | 57 |
// tetrahedron is 2.0 (ie standard, equal to numLayers |
... | ... | |
110 | 119 |
{ |
111 | 120 |
if( mQuats==null ) initializeQuats(); |
112 | 121 |
int status = retCubitSolvedStatus(cubit,numLayers); |
113 |
return status<0 ? null : buildSolvedQuats(MovementJing.FACE_AXIS[status],mQuats);
|
|
122 |
return status<0 ? null : buildSolvedQuats(Movement4.FACE_AXIS[status],mQuats);
|
|
114 | 123 |
} |
115 | 124 |
|
116 | 125 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
410 | 419 |
int numLayers = getNumLayers(); |
411 | 420 |
if( mCuts==null ) getCuts(numLayers); |
412 | 421 |
getLayerRotatable(numLayers); |
413 |
|
|
414 |
mMovement = new MovementJing(mCuts,mLayerRotatable,numLayers); |
|
422 |
mMovement = new Movement4(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_NOT_SPLIT,NUM_ENABLED,ENABLED); |
|
415 | 423 |
} |
416 | 424 |
return mMovement; |
417 | 425 |
} |
Also available in: Unified diff
Do away with the last method in the object Movement classes. Remove the object Movement classes altogether.
From now on the implementation of a TwistyPuzzle is 100% data, no code at all.
Next step: make the implementation a (generated?) (XML?) file.