Revision b19a1d32
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/objectlib/main/ObjectType.java | ||
---|---|---|
66 | 66 |
SQU2_3 ( new int[] {3,2,3} , 24, R.drawable.s_squ2_3, R.drawable.m_squ2_3, R.drawable.b_squ2_3, R.drawable.h_squ2_3), |
67 | 67 |
MIRR_2 ( new int[] {2,2,2} , 12, R.drawable.s_mirr_2, R.drawable.m_mirr_2, R.drawable.b_mirr_2, R.drawable.h_mirr_2), |
68 | 68 |
MIRR_3 ( new int[] {3,3,3} , 17, R.drawable.s_mirr_3, R.drawable.m_mirr_3, R.drawable.b_mirr_3, R.drawable.h_mirr_3), |
69 |
|
|
70 |
CU_223 ( new int[] {2,3,2} , 16, R.drawable.s_cube_2, R.drawable.m_cube_2, R.drawable.b_cube_2, R.drawable.h_cube_2), |
|
71 |
CU_334 ( new int[] {3,4,3} , 20, R.drawable.s_cube_3, R.drawable.m_cube_3, R.drawable.b_cube_3, R.drawable.h_cube_3), |
|
72 |
CU_122 ( new int[] {1,2,2} , 20, R.drawable.s_cube_3, R.drawable.m_cube_3, R.drawable.b_cube_3, R.drawable.h_cube_3), |
|
73 |
CU_321 ( new int[] {3,2,1} , 20, R.drawable.s_cube_3, R.drawable.m_cube_3, R.drawable.b_cube_3, R.drawable.h_cube_3), |
|
74 |
CU_111 ( new int[] {1,1,1} , 20, R.drawable.s_cube_3, R.drawable.m_cube_3, R.drawable.b_cube_3, R.drawable.h_cube_3), |
|
75 |
CU_141 ( new int[] {1,4,1} , 20, R.drawable.s_cube_3, R.drawable.m_cube_3, R.drawable.b_cube_3, R.drawable.h_cube_3), |
|
76 |
|
|
69 |
CU_323 ( new int[] {3,2,3} , 15, R.drawable.s_cu_323, R.drawable.m_cu_323, R.drawable.b_cu_323, R.drawable.h_cu_323), |
|
70 |
CU_232 ( new int[] {2,3,2} , 16, R.drawable.s_cu_232, R.drawable.m_cu_232, R.drawable.b_cu_232, R.drawable.h_cu_232), |
|
71 |
CU_343 ( new int[] {3,4,3} , 23, R.drawable.s_cu_343, R.drawable.m_cu_343, R.drawable.b_cu_343, R.drawable.h_cu_343), |
|
77 | 72 |
; |
78 | 73 |
|
79 | 74 |
public static final int NUM_OBJECTS = values().length; |
... | ... | |
174 | 169 |
|
175 | 170 |
switch(ord) |
176 | 171 |
{ |
177 |
case 32: |
|
178 |
case 33: |
|
179 |
case 34: |
|
180 |
case 35: |
|
181 |
case 36: |
|
182 |
case 37: |
|
183 |
|
|
184 | 172 |
case 0: |
185 | 173 |
case 1: |
186 | 174 |
case 2: |
... | ... | |
213 | 201 |
case 29: return new TwistySquare2 (numL, quat, move, texture, mesh, effects, res, surfaceW, surfaceH); |
214 | 202 |
case 30: |
215 | 203 |
case 31: return new TwistyMirror (numL, quat, move, texture, mesh, effects, res, surfaceW, surfaceH); |
204 |
case 32: |
|
205 |
case 33: |
|
206 |
case 34: return new TwistyCuboid (numL, quat, move, texture, mesh, effects, res, surfaceW, surfaceH); |
|
216 | 207 |
} |
217 | 208 |
|
218 | 209 |
return null; |
src/main/java/org/distorted/objectlib/objects/TwistyCuboid.java | ||
---|---|---|
187 | 187 |
{ |
188 | 188 |
int x = numLayers[0]; |
189 | 189 |
int y = numLayers[1]; |
190 |
int z = numLayers[2]; |
|
191 | 190 |
|
192 |
if( x==y && x==z )
|
|
191 |
switch(x)
|
|
193 | 192 |
{ |
194 |
switch(x) |
|
195 |
{ |
|
196 |
case 2: return R.raw.cube2; |
|
197 |
case 3: return R.raw.cube3; |
|
198 |
case 4: return R.raw.cube4; |
|
199 |
case 5: return R.raw.cube5; |
|
200 |
} |
|
193 |
case 2: return y==2 ? R.raw.cube2 : R.raw.cu_232; |
|
194 |
case 3: switch(y) |
|
195 |
{ |
|
196 |
case 2: return R.raw.cu_323; |
|
197 |
case 3: return R.raw.cube3; |
|
198 |
case 4: return R.raw.cu_343; |
|
199 |
} |
|
200 |
case 4: return R.raw.cube4; |
|
201 |
case 5: return R.raw.cube5; |
|
201 | 202 |
} |
202 | 203 |
|
203 | 204 |
return 0; |
... | ... | |
650 | 651 |
} |
651 | 652 |
|
652 | 653 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
653 |
// TODO |
|
654 | 654 |
|
655 | 655 |
public ObjectType intGetObjectType(int[] numLayers) |
656 | 656 |
{ |
657 |
switch(numLayers[0]) |
|
657 |
int x = numLayers[0]; |
|
658 |
int y = numLayers[1]; |
|
659 |
|
|
660 |
switch(x) |
|
658 | 661 |
{ |
659 |
case 2: return ObjectType.CUBE_2; |
|
660 |
case 3: return ObjectType.CUBE_3; |
|
662 |
case 2: switch(y) |
|
663 |
{ |
|
664 |
case 2: return ObjectType.CUBE_2; |
|
665 |
case 3: return ObjectType.CU_232; |
|
666 |
} |
|
667 |
case 3: switch(y) |
|
668 |
{ |
|
669 |
case 2: return ObjectType.CU_323; |
|
670 |
case 3: return ObjectType.CUBE_3; |
|
671 |
case 4: return ObjectType.CU_343; |
|
672 |
} |
|
661 | 673 |
case 4: return ObjectType.CUBE_4; |
662 | 674 |
case 5: return ObjectType.CUBE_5; |
663 | 675 |
} |
Also available in: Unified diff
Cuboids: fully implement the first 3 cuboids (2x3x2, 3x2x3, 3x4x3)