Project

General

Profile

Download (17.6 KB) Statistics
| Branch: | Tag: | Revision:

magiccube / src / main / java / org / distorted / objects / TwistyHelicopter.java @ 6cf89a3e

1 ee35e63c Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2020 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6
// Magic Cube is free software: you can redistribute it and/or modify                            //
7
// it under the terms of the GNU General Public License as published by                          //
8
// the Free Software Foundation, either version 2 of the License, or                             //
9
// (at your option) any later version.                                                           //
10
//                                                                                               //
11
// Magic Cube is distributed in the hope that it will be useful,                                 //
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
14
// GNU General Public License for more details.                                                  //
15
//                                                                                               //
16
// You should have received a copy of the GNU General Public License                             //
17
// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
18
///////////////////////////////////////////////////////////////////////////////////////////////////
19
20
package org.distorted.objects;
21
22
import android.content.res.Resources;
23
24 a2a4df1b Leszek Koltunski
import org.distorted.helpers.ObjectShape;
25 9c06394a Leszek Koltunski
import org.distorted.helpers.ObjectSticker;
26 6cf89a3e Leszek Koltunski
import org.distorted.helpers.ScrambleState;
27 ee35e63c Leszek Koltunski
import org.distorted.library.main.DistortedEffects;
28
import org.distorted.library.main.DistortedTexture;
29
import org.distorted.library.mesh.MeshSquare;
30
import org.distorted.library.type.Static3D;
31
import org.distorted.library.type.Static4D;
32 6fd4a72c Leszek Koltunski
import org.distorted.main.R;
33 ee35e63c Leszek Koltunski
34
import java.util.Random;
35
36
///////////////////////////////////////////////////////////////////////////////////////////////////
37
38 9c2f0c91 Leszek Koltunski
public class TwistyHelicopter extends TwistyObject
39 ee35e63c Leszek Koltunski
{
40
  private static final int FACES_PER_CUBIT =6;
41
42
  // the six rotation axis of a Helicopter. Must be normalized.
43
  static final Static3D[] ROT_AXIS = new Static3D[]
44
         {
45
           new Static3D(     0, +SQ2/2, -SQ2/2),
46
           new Static3D(     0, -SQ2/2, -SQ2/2),
47
           new Static3D(+SQ2/2,      0, -SQ2/2),
48
           new Static3D(-SQ2/2,      0, -SQ2/2),
49
           new Static3D(+SQ2/2, -SQ2/2,      0),
50
           new Static3D(-SQ2/2, -SQ2/2,      0)
51
         };
52
53 925ed78f Leszek Koltunski
  private static final int[] BASIC_ANGLE = new int[] { 2,2,2,2,2,2 };
54
55 ee35e63c Leszek Koltunski
  private static final int[] FACE_COLORS = new int[]
56
         {
57 ece1b58d Leszek Koltunski
           COLOR_YELLOW, COLOR_WHITE,
58
           COLOR_BLUE  , COLOR_GREEN,
59 323b217c Leszek Koltunski
           COLOR_RED   , COLOR_ORANGE
60 ee35e63c Leszek Koltunski
         };
61
62
  // All legal rotation quats of a HELICOPTER (same as the Cube!)
63
  private static final Static4D[] QUATS = new Static4D[]
64
         {
65
           new Static4D( 0.00f,  0.00f,  0.00f,  1.00f ),
66
           new Static4D( 1.00f,  0.00f,  0.00f,  0.00f ),
67
           new Static4D( 0.00f,  1.00f,  0.00f,  0.00f ),
68
           new Static4D( 0.00f,  0.00f,  1.00f,  0.00f ),
69
70
           new Static4D( SQ2/2,  SQ2/2,  0.00f,  0.00f ),
71
           new Static4D( SQ2/2, -SQ2/2,  0.00f,  0.00f ),
72
           new Static4D( SQ2/2,  0.00f,  SQ2/2,  0.00f ),
73
           new Static4D( SQ2/2,  0.00f, -SQ2/2,  0.00f ),
74
           new Static4D( SQ2/2,  0.00f,  0.00f,  SQ2/2 ),
75
           new Static4D( SQ2/2,  0.00f,  0.00f, -SQ2/2 ),
76
           new Static4D( 0.00f,  SQ2/2,  SQ2/2,  0.00f ),
77
           new Static4D( 0.00f,  SQ2/2, -SQ2/2,  0.00f ),
78
           new Static4D( 0.00f,  SQ2/2,  0.00f,  SQ2/2 ),
79
           new Static4D( 0.00f,  SQ2/2,  0.00f, -SQ2/2 ),
80
           new Static4D( 0.00f,  0.00f,  SQ2/2,  SQ2/2 ),
81
           new Static4D( 0.00f,  0.00f,  SQ2/2, -SQ2/2 ),
82
83
           new Static4D( 0.50f,  0.50f,  0.50f,  0.50f ),
84
           new Static4D( 0.50f,  0.50f,  0.50f, -0.50f ),
85
           new Static4D( 0.50f,  0.50f, -0.50f,  0.50f ),
86
           new Static4D( 0.50f,  0.50f, -0.50f, -0.50f ),
87
           new Static4D( 0.50f, -0.50f,  0.50f,  0.50f ),
88
           new Static4D( 0.50f, -0.50f,  0.50f, -0.50f ),
89
           new Static4D( 0.50f, -0.50f, -0.50f,  0.50f ),
90
           new Static4D( 0.50f, -0.50f, -0.50f, -0.50f )
91
         };
92
93
  private static final float DIST_CORNER = 0.50f;
94 b0a56742 Leszek Koltunski
  private static final float DIST_CENTER = 0.50f;
95 ee35e63c Leszek Koltunski
  private static final float XY_CENTER   = DIST_CORNER/3;
96
97
  // centers of the 8 corners + 6*4 face triangles ( i.e. of the all 32 cubits)
98 e6cf7283 Leszek Koltunski
  private static final float[][] CENTERS = new float[][]
99 ee35e63c Leszek Koltunski
         {
100 e6cf7283 Leszek Koltunski
             {   DIST_CORNER,   DIST_CORNER,   DIST_CORNER },
101
             {   DIST_CORNER,   DIST_CORNER,  -DIST_CORNER },
102
             {   DIST_CORNER,  -DIST_CORNER,   DIST_CORNER },
103
             {   DIST_CORNER,  -DIST_CORNER,  -DIST_CORNER },
104
             {  -DIST_CORNER,   DIST_CORNER,   DIST_CORNER },
105
             {  -DIST_CORNER,   DIST_CORNER,  -DIST_CORNER },
106
             {  -DIST_CORNER,  -DIST_CORNER,   DIST_CORNER },
107
             {  -DIST_CORNER,  -DIST_CORNER,  -DIST_CORNER },
108
109
             {   DIST_CENTER,     XY_CENTER,     XY_CENTER },
110
             {   DIST_CENTER,     XY_CENTER,    -XY_CENTER },
111
             {   DIST_CENTER,    -XY_CENTER,     XY_CENTER },
112
             {   DIST_CENTER,    -XY_CENTER,    -XY_CENTER },
113
114
             {  -DIST_CENTER,     XY_CENTER,     XY_CENTER },
115
             {  -DIST_CENTER,     XY_CENTER,    -XY_CENTER },
116
             {  -DIST_CENTER,    -XY_CENTER,     XY_CENTER },
117
             {  -DIST_CENTER,    -XY_CENTER,    -XY_CENTER },
118
119
             {   XY_CENTER  ,   DIST_CENTER,     XY_CENTER },
120
             {   XY_CENTER  ,   DIST_CENTER,    -XY_CENTER },
121
             {  -XY_CENTER  ,   DIST_CENTER,     XY_CENTER },
122
             {  -XY_CENTER  ,   DIST_CENTER,    -XY_CENTER },
123
124
             {   XY_CENTER  ,  -DIST_CENTER,     XY_CENTER },
125
             {   XY_CENTER  ,  -DIST_CENTER,    -XY_CENTER },
126
             {  -XY_CENTER  ,  -DIST_CENTER,     XY_CENTER },
127
             {  -XY_CENTER  ,  -DIST_CENTER,    -XY_CENTER },
128
129
             {   XY_CENTER  ,     XY_CENTER,   DIST_CENTER },
130
             {   XY_CENTER  ,    -XY_CENTER,   DIST_CENTER },
131
             {  -XY_CENTER  ,     XY_CENTER,   DIST_CENTER },
132
             {  -XY_CENTER  ,    -XY_CENTER,   DIST_CENTER },
133
134
             {   XY_CENTER  ,     XY_CENTER,  -DIST_CENTER },
135
             {   XY_CENTER  ,    -XY_CENTER,  -DIST_CENTER },
136
             {  -XY_CENTER  ,     XY_CENTER,  -DIST_CENTER },
137
             {  -XY_CENTER  ,    -XY_CENTER,  -DIST_CENTER },
138 ee35e63c Leszek Koltunski
         };
139
140
  // Colors of the faces of cubits. Each cubit has 6 faces
141
  private static final int[][] mFaceMap = new int[][]
142
         {
143
           { 4,2,0, 6,6,6 },
144 20a0214b Leszek Koltunski
           { 0,2,5, 6,6,6 },
145
           { 4,0,3, 6,6,6 },
146 ee35e63c Leszek Koltunski
           { 5,3,0, 6,6,6 },
147
           { 1,2,4, 6,6,6 },
148
           { 5,2,1, 6,6,6 },
149
           { 4,3,1, 6,6,6 },
150
           { 1,3,5, 6,6,6 },
151
152
           { 0 , 6,6,6,6,6 },
153
           { 0 , 6,6,6,6,6 },
154
           { 0 , 6,6,6,6,6 },
155
           { 0 , 6,6,6,6,6 },
156
157
           { 1 , 6,6,6,6,6 },
158
           { 1 , 6,6,6,6,6 },
159
           { 1 , 6,6,6,6,6 },
160
           { 1 , 6,6,6,6,6 },
161
162
           { 2 , 6,6,6,6,6 },
163
           { 2 , 6,6,6,6,6 },
164
           { 2 , 6,6,6,6,6 },
165
           { 2 , 6,6,6,6,6 },
166
167
           { 3 , 6,6,6,6,6 },
168
           { 3 , 6,6,6,6,6 },
169
           { 3 , 6,6,6,6,6 },
170
           { 3 , 6,6,6,6,6 },
171
172
           { 4 , 6,6,6,6,6 },
173
           { 4 , 6,6,6,6,6 },
174
           { 4 , 6,6,6,6,6 },
175
           { 4 , 6,6,6,6,6 },
176
177
           { 5 , 6,6,6,6,6 },
178
           { 5 , 6,6,6,6,6 },
179
           { 5 , 6,6,6,6,6 },
180
           { 5 , 6,6,6,6,6 },
181
         };
182
183 a64e07d0 Leszek Koltunski
  private static final int[] QUAT_INDICES =
184 20a0214b Leszek Koltunski
      { 0,13,14,1,12,2,3,7,20,6,13,17,7,23,18,12,22,10,8,16,11,21,19,9,3,15,14,0,5,2,1,4 };
185
186 0919eba7 Leszek Koltunski
  private static final double[][] VERTICES_CORNER = new double[][]
187 b1f2ccf5 Leszek Koltunski
          {
188 0919eba7 Leszek Koltunski
            {-0.50f, 0.00f, 0.00f},
189
            { 0.00f,-0.50f, 0.00f},
190
            { 0.00f, 0.00f,-0.50f},
191
            {-0.25f,-0.25f,-0.25f},
192
            { 0.00f, 0.00f, 0.00f}
193 b1f2ccf5 Leszek Koltunski
          };
194
195 0919eba7 Leszek Koltunski
  private static final int[][] VERT_INDEXES_CORNER = new int[][]
196 b1f2ccf5 Leszek Koltunski
          {
197 0919eba7 Leszek Koltunski
            {0,1,4},
198
            {2,0,4},
199
            {1,2,4},
200
            {3,1,0},
201
            {3,2,1},
202
            {3,0,2}
203 b1f2ccf5 Leszek Koltunski
          };
204
205 0919eba7 Leszek Koltunski
  private static final float E = 0.1666666f;
206
207
  private static final double[][] VERTICES_FACE = new double[][]
208
          {
209
            { 0.00f +E, 0.00f +E, 0.00f },
210 728cff8b Leszek Koltunski
            {-0.50f +E, 0.00f +E, 0.00f },
211
            { 0.00f +E,-0.50f +E, 0.00f },
212
            {-0.25f +E,-0.25f +E,-0.25f },
213 0919eba7 Leszek Koltunski
          };
214
215
  private static final int[][] VERT_INDEXES_FACE = new int[][]
216 b1f2ccf5 Leszek Koltunski
          {
217 0919eba7 Leszek Koltunski
            { 0,1,2 },
218
            { 2,1,3 },
219
            { 0,1,3 },
220
            { 2,0,3 }
221 b1f2ccf5 Leszek Koltunski
          };
222
223 0919eba7 Leszek Koltunski
  private static final float[][] STICKERS = new float[][]
224 b1f2ccf5 Leszek Koltunski
          {
225 0919eba7 Leszek Koltunski
            { -0.5f, 0.25f, 0.25f, -0.5f, 0.25f, 0.25f }
226 b1f2ccf5 Leszek Koltunski
          };
227
228 9c06394a Leszek Koltunski
  private static final ObjectSticker[] mStickers;
229
230
  static
231
    {
232
    float radius = 0.03f;
233
    float stroke = 0.05f;
234
    float[] radii = new float[] {radius,radius,radius};
235
    mStickers = new ObjectSticker[STICKERS.length];
236
    mStickers[0] = new ObjectSticker(STICKERS[0],null,radii,stroke);
237
    }
238 ee35e63c Leszek Koltunski
239 486b3417 Leszek Koltunski
  private int mCurrState;
240
  private int mIndexExcluded;
241 6cf89a3e Leszek Koltunski
  private final ScrambleState[] mStates;
242 486b3417 Leszek Koltunski
243 ee35e63c Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
244
245 9c2f0c91 Leszek Koltunski
  TwistyHelicopter(int size, Static4D quat, DistortedTexture texture,
246
                   MeshSquare mesh, DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
247 ee35e63c Leszek Koltunski
    {
248 db875721 Leszek Koltunski
    super(size, size, quat, texture, mesh, effects, moves, ObjectList.HELI, res, scrWidth);
249 486b3417 Leszek Koltunski
250 6cf89a3e Leszek Koltunski
    mStates = new ScrambleState[]
251 486b3417 Leszek Koltunski
      {
252 6cf89a3e Leszek Koltunski
      new ScrambleState( new int[][] { {0,1,1,2,1,2},{0,1,3,2,1,4},{0,1,5,2,1,6},{0,1,7,2,1,8},{0,1,9,2,1,10},{0,1,11,2,1,12} } ),
253
      new ScrambleState( new int[][] { {           },{           },{0,1,5      },{0,1,7      },{      2,1,10},{       2,1,12} } ),
254
      new ScrambleState( new int[][] { {           },{           },{      2,1,6},{      2,1,8},{0,1,9       },{0,1,11       } } ),
255
      new ScrambleState( new int[][] { {           },{           },{0,1,5      },{0,1,7      },{0,1,9       },{0,1,11       } } ),
256
      new ScrambleState( new int[][] { {           },{           },{      2,1,6},{      2,1,8},{      2,1,10},{       2,1,12} } ),
257
      new ScrambleState( new int[][] { {0,1,1      },{0,1,3      },{           },{           },{0,1,9       },{       2,1,12} } ),
258
      new ScrambleState( new int[][] { {      2,1,2},{      2,1,4},{           },{           },{      2,1,10},{0,1,11       } } ),
259
      new ScrambleState( new int[][] { {0,1,1      },{0,1,3      },{           },{           },{      2,1,10},{0,1,11       } } ),
260
      new ScrambleState( new int[][] { {      2,1,2},{      2,1,4},{           },{           },{0,1,9       },{       2,1,12} } ),
261
      new ScrambleState( new int[][] { {      2,1,2},{0,1,3      },{0,1,5      },{      2,1,8},{            },{             } } ),
262
      new ScrambleState( new int[][] { {0,1,1      },{      2,1,4},{      2,1,6},{0,1,7      },{            },{             } } ),
263
      new ScrambleState( new int[][] { {      2,1,2},{0,1,3      },{      2,1,6},{0,1,7      },{            },{             } } ),
264
      new ScrambleState( new int[][] { {0,1,1      },{      2,1,4},{0,1,5      },{      2,1,8},{            },{             } } ),
265 486b3417 Leszek Koltunski
      };
266 b1f2ccf5 Leszek Koltunski
    }
267
268 a480ee80 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
269
270
  int[] getSolvedQuats(int cubit, int numLayers)
271
    {
272
    int status = retCubitSolvedStatus(cubit,numLayers);
273
    return status<0 ? null : buildSolvedQuats(MovementHelicopter.FACE_AXIS[status],QUATS);
274
    }
275
276 ee35e63c Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
277
278
  float getScreenRatio()
279
    {
280 e06e1b7e Leszek Koltunski
    return 1.6f;
281 ee35e63c Leszek Koltunski
    }
282
283
///////////////////////////////////////////////////////////////////////////////////////////////////
284
285
  Static4D[] getQuats()
286
    {
287
    return QUATS;
288
    }
289
290 eaee1ddc Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
291
292
  boolean shouldResetTextureMaps()
293
    {
294
    return false;
295
    }
296
297 ee35e63c Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
298
299
  int getNumFaces()
300
    {
301
    return FACE_COLORS.length;
302
    }
303
304 169219a7 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
305
306
  int getSolvedFunctionIndex()
307
    {
308
    return 0;
309
    }
310
311 ee35e63c Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
312
313 a64e07d0 Leszek Koltunski
  int getNumStickerTypes(int numLayers)
314 ee35e63c Leszek Koltunski
    {
315 680469e6 Leszek Koltunski
    return STICKERS.length;
316 ee35e63c Leszek Koltunski
    }
317
318 7403cdfa Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
319
320 e6734aa9 Leszek Koltunski
  float[][] getCuts(int size)
321 7403cdfa Leszek Koltunski
    {
322 e6734aa9 Leszek Koltunski
    float[] cut = new float[] { -SQ2/4, +SQ2/4 };
323
    return new float[][] { cut,cut,cut,cut,cut,cut };
324 7403cdfa Leszek Koltunski
    }
325
326 ee35e63c Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
327
328
  int getNumCubitFaces()
329
    {
330
    return FACES_PER_CUBIT;
331
    }
332
333
///////////////////////////////////////////////////////////////////////////////////////////////////
334
335 e6cf7283 Leszek Koltunski
  float[][] getCubitPositions(int size)
336 ee35e63c Leszek Koltunski
    {
337
    return CENTERS;
338
    }
339
340 a2a4df1b Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
341
342
  ObjectShape getObjectShape(int cubit, int numLayers)
343
    {
344
    int variant = getCubitVariant(cubit,numLayers);
345
346
    if( variant==0 )
347
      {
348 3e605536 Leszek Koltunski
      float[][] bands     = new float[][] { {0.028f,35,0.16f,0.7f,7,3,3}, {0.000f, 0,1.00f,0.0f,3,1,5} };
349 a2a4df1b Leszek Koltunski
      int[] bandIndices   = new int[] { 0,0,0,1,1,1 };
350
      float[][] corners   = new float[][] { {0.08f,0.15f}, {0.08f,0.20f} };
351
      int[] cornerIndices = new int[] { 1,1,1,0,0 };
352
      float[][] centers   = new float[][] { {-0.25f, -0.25f, -0.25f} };
353
      int[] centerIndices = new int[] { 0,0,0,-1,0 };
354
      return new ObjectShape(VERTICES_CORNER,VERT_INDEXES_CORNER,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
355
      }
356
    else
357
      {
358 3e605536 Leszek Koltunski
      float[][] bands     = new float[][] { {0.028f,35,0.16f,0.7f,7,3,3}, {0.000f, 0,1.00f,0.0f,3,1,3} };
359 a2a4df1b Leszek Koltunski
      int[] bandIndices   = new int[] { 0,1,1,1 };
360
      float[][] corners   = new float[][] { {0.06f,0.15f}, {0.06f,0.20f} };
361
      int[] cornerIndices = new int[] { 0,1,1,-1 };
362
      float[][] centers   = new float[][] { {-1.0f/12, -1.0f/12, -1.0f/4} };
363
      int[] centerIndices = new int[] { 0,0,0,-1 };
364
      return new ObjectShape(VERTICES_FACE,VERT_INDEXES_FACE,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
365
      }
366
    }
367
368
///////////////////////////////////////////////////////////////////////////////////////////////////
369
370 3e605536 Leszek Koltunski
  Static4D getQuat(int cubit, int numLayers)
371 a2a4df1b Leszek Koltunski
    {
372
    return QUATS[QUAT_INDICES[cubit]];
373
    }
374
375
///////////////////////////////////////////////////////////////////////////////////////////////////
376
377 3e605536 Leszek Koltunski
  int getNumCubitVariants(int numLayers)
378 a2a4df1b Leszek Koltunski
    {
379
    return 2;
380
    }
381
382
///////////////////////////////////////////////////////////////////////////////////////////////////
383
384
  int getCubitVariant(int cubit, int numLayers)
385
    {
386
    return cubit<8 ? 0:1;
387
    }
388
389 ee35e63c Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
390
391
  int getFaceColor(int cubit, int cubitface, int size)
392
    {
393
    return mFaceMap[cubit][cubitface];
394
    }
395
396
///////////////////////////////////////////////////////////////////////////////////////////////////
397
398 9c06394a Leszek Koltunski
  int getColor(int face)
399 ee35e63c Leszek Koltunski
    {
400 9c06394a Leszek Koltunski
    return FACE_COLORS[face];
401
    }
402 ee35e63c Leszek Koltunski
403 9c06394a Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
404
405
  ObjectSticker retSticker(int face)
406
    {
407
    return mStickers[face/NUM_FACES];
408 ee35e63c Leszek Koltunski
    }
409
410
///////////////////////////////////////////////////////////////////////////////////////////////////
411
412
  float returnMultiplier()
413
    {
414
    return 2.0f;
415
    }
416
417
///////////////////////////////////////////////////////////////////////////////////////////////////
418
// PUBLIC API
419
420
  public Static3D[] getRotationAxis()
421
    {
422
    return ROT_AXIS;
423
    }
424
425
///////////////////////////////////////////////////////////////////////////////////////////////////
426
427 925ed78f Leszek Koltunski
  public int[] getBasicAngle()
428 ee35e63c Leszek Koltunski
    {
429 925ed78f Leszek Koltunski
    return BASIC_ANGLE;
430 ee35e63c Leszek Koltunski
    }
431
432
///////////////////////////////////////////////////////////////////////////////////////////////////
433
434 486b3417 Leszek Koltunski
  public void randomizeNewScramble(int[][] scramble, Random rnd, int curr, int totalScrambles)
435 ee35e63c Leszek Koltunski
    {
436 9f171eba Leszek Koltunski
    if( curr==0 )
437 ee35e63c Leszek Koltunski
      {
438 486b3417 Leszek Koltunski
      mCurrState     = 0;
439
      mIndexExcluded =-1;
440 ee35e63c Leszek Koltunski
      }
441
442 486b3417 Leszek Koltunski
    int total = mStates[mCurrState].getTotal(mIndexExcluded);
443
    int random= rnd.nextInt(total);
444
    int[] info= mStates[mCurrState].getInfo(random,mIndexExcluded);
445 ee35e63c Leszek Koltunski
446 486b3417 Leszek Koltunski
    scramble[curr][0] = info[0];
447
    scramble[curr][1] = info[1];
448
    scramble[curr][2] = info[2];
449
450
    mCurrState     = info[3];
451
    mIndexExcluded = info[0];
452 ee35e63c Leszek Koltunski
    }
453
454 6fd4a72c Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
455
456
  public int getObjectName(int numLayers)
457
    {
458
    return R.string.heli3;
459
    }
460
461
///////////////////////////////////////////////////////////////////////////////////////////////////
462
463
  public int getInventor(int numLayers)
464
    {
465
    return R.string.heli3_inventor;
466
    }
467
468
///////////////////////////////////////////////////////////////////////////////////////////////////
469
470
  public int getComplexity(int numLayers)
471
    {
472
    return 8;
473
    }
474 ee35e63c Leszek Koltunski
}