Revision 967c1d17
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/objects/TwistyDiamond.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; |
... | ... | |
44 | 46 |
new Static3D( 0,-SQ3/3,+SQ6/3) |
45 | 47 |
}; |
46 | 48 |
|
49 |
private static final int[] NUM_ENABLED = {3,3,3,3,3,3,3,3}; |
|
50 |
|
|
51 |
private static final int[][][] ENABLED = new int[][][] |
|
52 |
{ |
|
53 |
{{1,2,3}},{{1,2,3}},{{0,2,3}},{{0,2,3}},{{0,1,3}},{{0,1,3}},{{0,1,2}},{{0,1,2}} |
|
54 |
}; |
|
55 |
|
|
47 | 56 |
private ScrambleState[] mStates; |
48 | 57 |
private int[] mBasicAngle; |
49 | 58 |
private int[] mFaceMap; |
... | ... | |
116 | 125 |
if( mQuats==null ) initializeQuats(); |
117 | 126 |
if( mFaceMap==null ) mFaceMap = new int[] {4,0,6,2,7,3,5,1}; |
118 | 127 |
int status = retCubitSolvedStatus(cubit,numLayers); |
119 |
return status<0 ? null : buildSolvedQuats(MovementDiamond.FACE_AXIS[mFaceMap[status]],mQuats);
|
|
128 |
return status<0 ? null : buildSolvedQuats(Movement8.FACE_AXIS[mFaceMap[status]],mQuats);
|
|
120 | 129 |
} |
121 | 130 |
|
122 | 131 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
497 | 506 |
int numLayers = getNumLayers(); |
498 | 507 |
if( mCuts==null ) getCuts(numLayers); |
499 | 508 |
getLayerRotatable(numLayers); |
500 |
|
|
501 |
mMovement = new MovementDiamond(mCuts,mLayerRotatable,numLayers); |
|
509 |
mMovement = new Movement8(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_NOT_SPLIT,NUM_ENABLED,ENABLED); |
|
502 | 510 |
} |
503 | 511 |
return mMovement; |
504 | 512 |
} |
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.