Revision bdbbb4c5
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/objects/TwistyRex.java | ||
---|---|---|
19 | 19 |
|
20 | 20 |
package org.distorted.objects; |
21 | 21 |
|
22 |
import static org.distorted.objects.Movement.TYPE_SPLIT_CORNER;
|
|
22 |
import static org.distorted.objectlb.Movement.TYPE_SPLIT_CORNER;
|
|
23 | 23 |
|
24 | 24 |
import android.content.res.Resources; |
25 | 25 |
|
26 |
import org.distorted.helpers.ObjectShape;
|
|
27 |
import org.distorted.helpers.ObjectSticker;
|
|
28 |
import org.distorted.helpers.ScrambleState;
|
|
26 |
import org.distorted.objectlb.ObjectShape;
|
|
27 |
import org.distorted.objectlb.ObjectSticker;
|
|
28 |
import org.distorted.objectlb.ScrambleState;
|
|
29 | 29 |
import org.distorted.library.main.DistortedEffects; |
30 | 30 |
import org.distorted.library.main.DistortedTexture; |
31 | 31 |
import org.distorted.library.mesh.MeshSquare; |
32 | 32 |
import org.distorted.library.type.Static3D; |
33 | 33 |
import org.distorted.library.type.Static4D; |
34 | 34 |
import org.distorted.main.R; |
35 |
import org.distorted.objectlb.Movement; |
|
36 |
import org.distorted.objectlb.Movement6; |
|
37 |
import org.distorted.objectlb.ObjectList; |
|
38 |
import org.distorted.objectlb.Twisty6; |
|
35 | 39 |
|
36 | 40 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
37 | 41 |
|
... | ... | |
68 | 72 |
|
69 | 73 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
70 | 74 |
|
71 |
TwistyRex(int size, Static4D quat, DistortedTexture texture, MeshSquare mesh, |
|
72 |
DistortedEffects effects, int[][] moves, Resources res, int scrWidth) |
|
75 |
public TwistyRex(int size, Static4D quat, DistortedTexture texture, MeshSquare mesh,
|
|
76 |
DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
|
|
73 | 77 |
{ |
74 | 78 |
super(size, size, quat, texture, mesh, effects, moves, ObjectList.REX, res, scrWidth); |
75 | 79 |
} |
76 | 80 |
|
77 | 81 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
78 | 82 |
|
79 |
ScrambleState[] getScrambleStates() |
|
83 |
protected ScrambleState[] getScrambleStates()
|
|
80 | 84 |
{ |
81 | 85 |
if( mStates==null ) |
82 | 86 |
{ |
... | ... | |
115 | 119 |
|
116 | 120 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
117 | 121 |
|
118 |
int[] getSolvedQuats(int cubit, int numLayers) |
|
122 |
protected int[] getSolvedQuats(int cubit, int numLayers)
|
|
119 | 123 |
{ |
120 | 124 |
if( mQuats==null ) initializeQuats(); |
121 | 125 |
int status = retCubitSolvedStatus(cubit,numLayers); |
... | ... | |
124 | 128 |
|
125 | 129 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
126 | 130 |
|
127 |
Static4D[] getQuats() |
|
131 |
protected Static4D[] getQuats()
|
|
128 | 132 |
{ |
129 | 133 |
if( mQuats==null ) initializeQuats(); |
130 | 134 |
return mQuats; |
... | ... | |
132 | 136 |
|
133 | 137 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
134 | 138 |
|
135 |
int getSolvedFunctionIndex() |
|
139 |
protected int getSolvedFunctionIndex()
|
|
136 | 140 |
{ |
137 | 141 |
return 0; |
138 | 142 |
} |
139 | 143 |
|
140 | 144 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
141 | 145 |
|
142 |
int getNumStickerTypes(int numLayers) |
|
146 |
protected int getNumStickerTypes(int numLayers)
|
|
143 | 147 |
{ |
144 | 148 |
return 3; |
145 | 149 |
} |
146 | 150 |
|
147 | 151 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
148 | 152 |
|
149 |
float[][] getCuts(int numLayers) |
|
153 |
protected float[][] getCuts(int numLayers)
|
|
150 | 154 |
{ |
151 | 155 |
if( mCuts==null ) |
152 | 156 |
{ |
... | ... | |
173 | 177 |
|
174 | 178 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
175 | 179 |
|
176 |
int getNumCubitFaces() |
|
180 |
protected int getNumCubitFaces()
|
|
177 | 181 |
{ |
178 | 182 |
return 6; |
179 | 183 |
} |
180 | 184 |
|
181 | 185 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
182 | 186 |
|
183 |
float[][] getCubitPositions(int numLayers) |
|
187 |
protected float[][] getCubitPositions(int numLayers)
|
|
184 | 188 |
{ |
185 | 189 |
final float DIST1= 1.50f; |
186 | 190 |
final float DIST2= (1+2*REX_D)/2; |
... | ... | |
238 | 242 |
|
239 | 243 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
240 | 244 |
|
241 |
ObjectShape getObjectShape(int cubit, int numLayers) |
|
245 |
protected ObjectShape getObjectShape(int cubit, int numLayers)
|
|
242 | 246 |
{ |
243 | 247 |
int variant = getCubitVariant(cubit,numLayers); |
244 | 248 |
|
... | ... | |
285 | 289 |
|
286 | 290 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
287 | 291 |
|
288 |
Static4D getQuat(int cubit, int numLayers) |
|
292 |
protected Static4D getQuat(int cubit, int numLayers)
|
|
289 | 293 |
{ |
290 | 294 |
if( mQuats==null ) initializeQuats(); |
291 | 295 |
|
... | ... | |
342 | 346 |
|
343 | 347 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
344 | 348 |
|
345 |
int getNumCubitVariants(int numLayers) |
|
349 |
protected int getNumCubitVariants(int numLayers)
|
|
346 | 350 |
{ |
347 | 351 |
return 3; |
348 | 352 |
} |
349 | 353 |
|
350 | 354 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
351 | 355 |
|
352 |
int getCubitVariant(int cubit, int numLayers) |
|
356 |
protected int getCubitVariant(int cubit, int numLayers)
|
|
353 | 357 |
{ |
354 | 358 |
return cubit<24 ? 0 : (cubit<30?1:2); |
355 | 359 |
} |
356 | 360 |
|
357 | 361 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
358 | 362 |
|
359 |
int getFaceColor(int cubit, int cubitface, int numLayers) |
|
363 |
protected int getFaceColor(int cubit, int cubitface, int numLayers)
|
|
360 | 364 |
{ |
361 | 365 |
if( mFaceMap==null ) |
362 | 366 |
{ |
... | ... | |
414 | 418 |
|
415 | 419 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
416 | 420 |
|
417 |
ObjectSticker retSticker(int face) |
|
421 |
protected ObjectSticker retSticker(int face)
|
|
418 | 422 |
{ |
419 | 423 |
if( mStickers==null ) |
420 | 424 |
{ |
Also available in: Unified diff
Refactoring: split the 'objects' package into two, 'objects' and 'objectlib'.
The point: we're going to need to move the 'objectlib' stuff into its own library module, and that's because we're going to create a new app module which needs access to it.