Revision bdbbb4c5
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/objects/TwistyIvy.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 |
|
... | ... | |
70 | 74 |
|
71 | 75 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
72 | 76 |
|
73 |
TwistyIvy(int size, Static4D quat, DistortedTexture texture,
|
|
74 |
MeshSquare mesh, DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
|
|
77 |
public TwistyIvy(int size, Static4D quat, DistortedTexture texture, MeshSquare mesh,
|
|
78 |
DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
|
|
75 | 79 |
{ |
76 | 80 |
super(size, size, quat, texture, mesh, effects, moves, ObjectList.IVY, res, scrWidth); |
77 | 81 |
} |
78 | 82 |
|
79 | 83 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
80 | 84 |
|
81 |
ScrambleState[] getScrambleStates() |
|
85 |
protected ScrambleState[] getScrambleStates()
|
|
82 | 86 |
{ |
83 | 87 |
if( mStates==null ) |
84 | 88 |
{ |
... | ... | |
117 | 121 |
|
118 | 122 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
119 | 123 |
|
120 |
int[] getSolvedQuats(int cubit, int numLayers) |
|
124 |
protected int[] getSolvedQuats(int cubit, int numLayers)
|
|
121 | 125 |
{ |
122 | 126 |
if( mQuats==null ) initializeQuats(); |
123 | 127 |
int status = retCubitSolvedStatus(cubit,numLayers); |
... | ... | |
126 | 130 |
|
127 | 131 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
128 | 132 |
|
129 |
Static4D[] getQuats() |
|
133 |
protected Static4D[] getQuats()
|
|
130 | 134 |
{ |
131 | 135 |
if( mQuats==null ) initializeQuats(); |
132 | 136 |
return mQuats; |
... | ... | |
134 | 138 |
|
135 | 139 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
136 | 140 |
|
137 |
int getSolvedFunctionIndex() |
|
141 |
protected int getSolvedFunctionIndex()
|
|
138 | 142 |
{ |
139 | 143 |
return 0; |
140 | 144 |
} |
141 | 145 |
|
142 | 146 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
143 | 147 |
|
144 |
int getNumStickerTypes(int numLayers) |
|
148 |
protected int getNumStickerTypes(int numLayers)
|
|
145 | 149 |
{ |
146 | 150 |
return NUM_STICKERS; |
147 | 151 |
} |
148 | 152 |
|
149 | 153 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
150 | 154 |
|
151 |
float[][] getCuts(int numLayers) |
|
155 |
protected float[][] getCuts(int numLayers)
|
|
152 | 156 |
{ |
153 | 157 |
if( mCuts==null ) |
154 | 158 |
{ |
... | ... | |
175 | 179 |
|
176 | 180 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
177 | 181 |
|
178 |
int getNumCubitFaces() |
|
182 |
protected int getNumCubitFaces()
|
|
179 | 183 |
{ |
180 | 184 |
return 6; |
181 | 185 |
} |
182 | 186 |
|
183 | 187 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
184 | 188 |
|
185 |
float[][] getCubitPositions(int numLayers) |
|
189 |
protected float[][] getCubitPositions(int numLayers)
|
|
186 | 190 |
{ |
187 | 191 |
final float DIST_CORNER = numLayers-1; |
188 | 192 |
final float DIST_CENTER = numLayers-1; |
... | ... | |
205 | 209 |
|
206 | 210 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
207 | 211 |
|
208 |
ObjectShape getObjectShape(int cubit, int numLayers) |
|
212 |
protected ObjectShape getObjectShape(int cubit, int numLayers)
|
|
209 | 213 |
{ |
210 | 214 |
int variant = getCubitVariant(cubit,numLayers); |
211 | 215 |
|
... | ... | |
362 | 366 |
|
363 | 367 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
364 | 368 |
|
365 |
Static4D getQuat(int cubit, int numLayers) |
|
369 |
protected Static4D getQuat(int cubit, int numLayers)
|
|
366 | 370 |
{ |
367 | 371 |
if( mQuats==null ) initializeQuats(); |
368 | 372 |
|
... | ... | |
386 | 390 |
|
387 | 391 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
388 | 392 |
|
389 |
int getNumCubitVariants(int numLayers) |
|
393 |
protected int getNumCubitVariants(int numLayers)
|
|
390 | 394 |
{ |
391 | 395 |
return 2; |
392 | 396 |
} |
393 | 397 |
|
394 | 398 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
395 | 399 |
|
396 |
int getCubitVariant(int cubit, int numLayers) |
|
400 |
protected int getCubitVariant(int cubit, int numLayers)
|
|
397 | 401 |
{ |
398 | 402 |
return cubit<4 ? 0:1; |
399 | 403 |
} |
400 | 404 |
|
401 | 405 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
402 | 406 |
|
403 |
int getFaceColor(int cubit, int cubitface, int numLayers) |
|
407 |
protected int getFaceColor(int cubit, int cubitface, int numLayers)
|
|
404 | 408 |
{ |
405 | 409 |
if( mFaceMap==null ) |
406 | 410 |
{ |
... | ... | |
425 | 429 |
|
426 | 430 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
427 | 431 |
|
428 |
ObjectSticker retSticker(int face) |
|
432 |
protected ObjectSticker retSticker(int face)
|
|
429 | 433 |
{ |
430 | 434 |
if( mStickers==null ) |
431 | 435 |
{ |
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.