Revision bdbbb4c5
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;
|
|
22 |
import static org.distorted.objectlb.Movement.TYPE_NOT_SPLIT;
|
|
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.Movement4; |
|
37 |
import org.distorted.objectlb.ObjectList; |
|
38 |
import org.distorted.objectlb.Twisty4; |
|
35 | 39 |
|
36 | 40 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
37 | 41 |
|
... | ... | |
67 | 71 |
|
68 | 72 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
69 | 73 |
|
70 |
TwistyJing(int size, Static4D quat, DistortedTexture texture, MeshSquare mesh, |
|
71 |
DistortedEffects effects, int[][] moves, Resources res, int scrWidth) |
|
74 |
public TwistyJing(int size, Static4D quat, DistortedTexture texture, MeshSquare mesh,
|
|
75 |
DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
|
|
72 | 76 |
{ |
73 | 77 |
super(size, size, quat, texture, mesh, effects, moves, ObjectList.JING, res, scrWidth); |
74 | 78 |
} |
75 | 79 |
|
76 | 80 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
77 | 81 |
|
78 |
ScrambleState[] getScrambleStates() |
|
82 |
protected ScrambleState[] getScrambleStates()
|
|
79 | 83 |
{ |
80 | 84 |
if( mStates==null ) |
81 | 85 |
{ |
... | ... | |
113 | 117 |
|
114 | 118 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
115 | 119 |
|
116 |
int[] getSolvedQuats(int cubit, int numLayers) |
|
120 |
protected int[] getSolvedQuats(int cubit, int numLayers)
|
|
117 | 121 |
{ |
118 | 122 |
if( mQuats==null ) initializeQuats(); |
119 | 123 |
int status = retCubitSolvedStatus(cubit,numLayers); |
... | ... | |
122 | 126 |
|
123 | 127 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
124 | 128 |
|
125 |
float[][] getCubitPositions(int size) |
|
129 |
protected float[][] getCubitPositions(int size)
|
|
126 | 130 |
{ |
127 | 131 |
if( mCenters==null ) |
128 | 132 |
{ |
... | ... | |
152 | 156 |
|
153 | 157 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
154 | 158 |
|
155 |
Static4D[] getQuats() |
|
159 |
protected Static4D[] getQuats()
|
|
156 | 160 |
{ |
157 | 161 |
if( mQuats==null ) initializeQuats(); |
158 | 162 |
return mQuats; |
... | ... | |
160 | 164 |
|
161 | 165 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
162 | 166 |
|
163 |
int getSolvedFunctionIndex() |
|
167 |
protected int getSolvedFunctionIndex()
|
|
164 | 168 |
{ |
165 | 169 |
return 0; |
166 | 170 |
} |
167 | 171 |
|
168 | 172 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
169 | 173 |
|
170 |
int getNumStickerTypes(int numLayers) |
|
174 |
protected int getNumStickerTypes(int numLayers)
|
|
171 | 175 |
{ |
172 | 176 |
return 3; |
173 | 177 |
} |
174 | 178 |
|
175 | 179 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
176 | 180 |
|
177 |
float[][] getCuts(int size) |
|
181 |
protected float[][] getCuts(int size)
|
|
178 | 182 |
{ |
179 | 183 |
if( mCuts==null ) |
180 | 184 |
{ |
... | ... | |
201 | 205 |
|
202 | 206 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
203 | 207 |
|
204 |
int getNumCubitFaces() |
|
208 |
protected int getNumCubitFaces()
|
|
205 | 209 |
{ |
206 | 210 |
return 6; |
207 | 211 |
} |
208 | 212 |
|
209 | 213 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
210 | 214 |
|
211 |
int getFaceColor(int cubit, int cubitface, int size) |
|
215 |
protected int getFaceColor(int cubit, int cubitface, int size)
|
|
212 | 216 |
{ |
213 | 217 |
if( mFaceMap==null ) |
214 | 218 |
{ |
... | ... | |
242 | 246 |
|
243 | 247 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
244 | 248 |
|
245 |
ObjectShape getObjectShape(int cubit, int numLayers) |
|
249 |
protected ObjectShape getObjectShape(int cubit, int numLayers)
|
|
246 | 250 |
{ |
247 | 251 |
int variant = getCubitVariant(cubit,numLayers); |
248 | 252 |
|
... | ... | |
350 | 354 |
|
351 | 355 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
352 | 356 |
|
353 |
Static4D getQuat(int cubit, int numLayers) |
|
357 |
protected Static4D getQuat(int cubit, int numLayers)
|
|
354 | 358 |
{ |
355 | 359 |
if( mQuats==null ) initializeQuats(); |
356 | 360 |
if( mRotQuat ==null ) mRotQuat = new int[] {0,1,2,7,0,2,7,6,3,10,0,1,3,5}; |
... | ... | |
359 | 363 |
|
360 | 364 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
361 | 365 |
|
362 |
int getNumCubitVariants(int numLayers) |
|
366 |
protected int getNumCubitVariants(int numLayers)
|
|
363 | 367 |
{ |
364 | 368 |
return 3; |
365 | 369 |
} |
366 | 370 |
|
367 | 371 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
368 | 372 |
|
369 |
int getCubitVariant(int cubit, int numLayers) |
|
373 |
protected int getCubitVariant(int cubit, int numLayers)
|
|
370 | 374 |
{ |
371 | 375 |
return cubit<4 ? 0 : (cubit<10?1:2); |
372 | 376 |
} |
373 | 377 |
|
374 | 378 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
375 | 379 |
|
376 |
ObjectSticker retSticker(int face) |
|
380 |
protected ObjectSticker retSticker(int face)
|
|
377 | 381 |
{ |
378 | 382 |
if( mStickers==null ) |
379 | 383 |
{ |
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.