Project

General

Profile

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

magiccube / src / main / java / org / distorted / objects / ObjectList.java @ 96208efc

1
///////////////////////////////////////////////////////////////////////////////////////////////////
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
import org.distorted.library.main.DistortedEffects;
25
import org.distorted.library.main.DistortedTexture;
26
import org.distorted.library.mesh.MeshSquare;
27
import org.distorted.library.type.Static4D;
28
import org.distorted.main.R;
29
import org.distorted.main.RubikActivity;
30

    
31
import java.lang.reflect.Field;
32

    
33
///////////////////////////////////////////////////////////////////////////////////////////////////
34

    
35
public enum ObjectList
36
  {
37
  ///////////////////// Size // DB Level // NumScrambles // Mesh // small icon // medium icon // big icon // huge icon
38

    
39
  CUBE (
40
         new int[][] {
41
                       {2 , 12, 12, R.raw.cube2, R.drawable.ui_small_cube2, R.drawable.ui_medium_cube2, R.drawable.ui_big_cube2, R.drawable.ui_huge_cube2} ,
42
                       {3 , 16, 17, R.raw.cube3, R.drawable.ui_small_cube3, R.drawable.ui_medium_cube3, R.drawable.ui_big_cube3, R.drawable.ui_huge_cube3} ,
43
                       {4 , 20, 24, R.raw.cube4, R.drawable.ui_small_cube4, R.drawable.ui_medium_cube4, R.drawable.ui_big_cube4, R.drawable.ui_huge_cube4} ,
44
                       {5 , 24, 28, R.raw.cube5, R.drawable.ui_small_cube5, R.drawable.ui_medium_cube5, R.drawable.ui_big_cube5, R.drawable.ui_huge_cube5}
45
                     },
46
         TwistyCube.class,
47
         0
48
       ),
49

    
50
  JING (
51
         new int[][] {
52
                       {2 , 11, 11, R.raw.jing, R.drawable.ui_small_jing2, R.drawable.ui_medium_jing2, R.drawable.ui_big_jing2, R.drawable.ui_huge_jing2} ,
53
                     },
54
         TwistyJing.class,
55
         1
56
       ),
57

    
58
  PYRA (
59
         new int[][] {
60
                       {3 , 10, 10, R.raw.pyra3, R.drawable.ui_small_pyra3, R.drawable.ui_medium_pyra3, R.drawable.ui_big_pyra3, R.drawable.ui_huge_pyra3} ,
61
                       {4 , 15, 17, R.raw.pyra4, R.drawable.ui_small_pyra4, R.drawable.ui_medium_pyra4, R.drawable.ui_big_pyra4, R.drawable.ui_huge_pyra4} ,
62
                       {5 , 20, 23, R.raw.pyra5, R.drawable.ui_small_pyra5, R.drawable.ui_medium_pyra5, R.drawable.ui_big_pyra5, R.drawable.ui_huge_pyra5}
63
                     },
64
         TwistyPyraminx.class,
65
         1
66
       ),
67

    
68
  KILO (
69
         new int[][] {
70
                       {3 , 18, 18, R.raw.kilo3, R.drawable.ui_small_kilo3, R.drawable.ui_medium_kilo3, R.drawable.ui_big_kilo3, R.drawable.ui_huge_kilo3} ,
71
                       {5 , 33, 33, R.raw.kilo5, R.drawable.ui_small_kilo5, R.drawable.ui_medium_kilo5, R.drawable.ui_big_kilo5, R.drawable.ui_huge_kilo5} ,
72
                     },
73
         TwistyKilominx.class,
74
         2
75
       ),
76

    
77
  MEGA (
78
         new int[][] {
79
                       {3 , 21, 21, R.raw.mega3, R.drawable.ui_small_mega3, R.drawable.ui_medium_mega3, R.drawable.ui_big_mega3, R.drawable.ui_huge_mega3} ,
80
                       {5 , 35, 37, R.raw.mega5, R.drawable.ui_small_mega5, R.drawable.ui_medium_mega5, R.drawable.ui_big_mega5, R.drawable.ui_huge_mega5} ,
81
                     },
82
         TwistyMegaminx.class,
83
         2
84
       ),
85

    
86
  ULTI (
87
         new int[][] {
88
                       {2 , 18, 18, R.raw.ulti, R.drawable.ui_small_ulti, R.drawable.ui_medium_ulti, R.drawable.ui_big_ulti, R.drawable.ui_huge_ulti} ,
89
                     },
90
         TwistyUltimate.class,
91
         3
92
       ),
93

    
94
  DIAM (
95
         new int[][] {
96
                       {2 , 10, 12, R.raw.diam2, R.drawable.ui_small_diam2, R.drawable.ui_medium_diam2, R.drawable.ui_big_diam2, R.drawable.ui_huge_diam2} ,
97
                       {3 , 18, 24, R.raw.diam3, R.drawable.ui_small_diam3, R.drawable.ui_medium_diam3, R.drawable.ui_big_diam3, R.drawable.ui_huge_diam3} ,
98
                       {4 , 32, 32, R.raw.diam4, R.drawable.ui_small_diam4, R.drawable.ui_medium_diam4, R.drawable.ui_big_diam4, R.drawable.ui_huge_diam4} ,
99
                     },
100
         TwistyDiamond.class,
101
         3
102
       ),
103

    
104
  DINO (
105
         new int[][] {
106
                       {3 , 10, 10, R.raw.dino, R.drawable.ui_small_dino, R.drawable.ui_medium_dino, R.drawable.ui_big_dino, R.drawable.ui_huge_dino} ,
107
                     },
108
         TwistyDino6.class,
109
         4
110
       ),
111

    
112
  DIN4 (
113
         new int[][] {
114
                       {3 , 7, 7, R.raw.dino, R.drawable.ui_small_din4, R.drawable.ui_medium_din4, R.drawable.ui_big_din4, R.drawable.ui_huge_din4} ,
115
                     },
116
         TwistyDino4.class,
117
         4
118
       ),
119

    
120
  REDI (
121
         new int[][] {
122
                       {3 , 14, 16, R.raw.redi, R.drawable.ui_small_redi, R.drawable.ui_medium_redi, R.drawable.ui_big_redi, R.drawable.ui_huge_redi} ,
123
                     },
124
         TwistyRedi.class,
125
         4
126
       ),
127

    
128
  HELI (
129
         new int[][] {
130
                       {3 , 18, 20, R.raw.heli, R.drawable.ui_small_heli, R.drawable.ui_medium_heli, R.drawable.ui_big_heli, R.drawable.ui_huge_heli} ,
131
                     },
132
         TwistyHelicopter.class,
133
         4
134
       ),
135

    
136
  SKEW (
137
         new int[][] {
138
                       {2 , 11, 11, R.raw.skew2, R.drawable.ui_small_skewb, R.drawable.ui_medium_skewb, R.drawable.ui_big_skewb, R.drawable.ui_huge_skewb} ,
139
                       {3 , 17, 21, R.raw.skew3, R.drawable.ui_small_skewm, R.drawable.ui_medium_skewm, R.drawable.ui_big_skewm, R.drawable.ui_huge_skewm} ,
140
                     },
141
         TwistySkewb.class,
142
         5
143
       ),
144

    
145
  IVY  (
146
         new int[][] {
147
                       {2 , 8, 8, R.raw.ivy, R.drawable.ui_small_ivy, R.drawable.ui_medium_ivy, R.drawable.ui_big_ivy, R.drawable.ui_huge_ivy} ,
148
                     },
149
         TwistyIvy.class,
150
         5
151
       ),
152

    
153
  REX  (
154
         new int[][] {
155
                       {3 , 16, 19, R.raw.rex, R.drawable.ui_small_rex, R.drawable.ui_medium_rex, R.drawable.ui_big_rex, R.drawable.ui_huge_rex} ,
156
                     },
157
         TwistyRex.class,
158
         5
159
       ),
160

    
161
  BAN1 (
162
         new int[][] {
163
                       {3 , 16, 16, R.raw.ban1, R.drawable.ui_small_ban1, R.drawable.ui_medium_ban1, R.drawable.ui_big_ban1, R.drawable.ui_huge_ban1} ,
164
                     },
165
         TwistyBandagedFused.class,
166
         6
167
       ),
168

    
169
  BAN2 (
170
         new int[][] {
171
                       {3 , 16, 16, R.raw.ban2, R.drawable.ui_small_ban2, R.drawable.ui_medium_ban2, R.drawable.ui_big_ban2, R.drawable.ui_huge_ban2} ,
172
                     },
173
         TwistyBandaged2Bar.class,
174
         6
175
       ),
176

    
177
  BAN3 (
178
         new int[][] {
179
                       {3 , 16, 16, R.raw.ban3, R.drawable.ui_small_ban3, R.drawable.ui_medium_ban3, R.drawable.ui_big_ban3, R.drawable.ui_huge_ban3} ,
180
                     },
181
         TwistyBandaged3Plate.class,
182
         6
183
       ),
184

    
185
  BAN4 (
186
         new int[][] {
187
                       {3 , 16, 16, R.raw.ban4, R.drawable.ui_small_ban4, R.drawable.ui_medium_ban4, R.drawable.ui_big_ban4, R.drawable.ui_huge_ban4} ,
188
                     },
189
         TwistyBandagedEvil.class,
190
         6
191
       ),
192

    
193
  SQU1 (
194
         new int[][] {
195
                       {3 , 24, 24, R.raw.square1, R.drawable.ui_small_square1, R.drawable.ui_medium_square1, R.drawable.ui_big_square1, R.drawable.ui_huge_square1} ,
196
                     },
197
         TwistySquare1.class,
198
         7
199
       ),
200

    
201
  SQU2 (
202
         new int[][] {
203
                       {3 , 24, 24, R.raw.square2, R.drawable.ui_small_square2, R.drawable.ui_medium_square2, R.drawable.ui_big_square2, R.drawable.ui_huge_square2} ,
204
                     },
205
         TwistySquare2.class,
206
         7
207
       ),
208

    
209
  MIRR (
210
         new int[][] {
211
                       {2 , 12, 12, R.raw.mirr2, R.drawable.ui_small_mirr2, R.drawable.ui_medium_mirr2, R.drawable.ui_big_mirr2, R.drawable.ui_huge_mirr2} ,
212
                       {3 , 16, 17, R.raw.mirr3, R.drawable.ui_small_mirr3, R.drawable.ui_medium_mirr3, R.drawable.ui_big_mirr3, R.drawable.ui_huge_mirr3} ,
213
                     },
214
         TwistyMirror.class,
215
         7
216
       ),
217
  ;
218

    
219
  public static final int NUM_OBJECTS = values().length;
220
  public static final int MAX_NUM_OBJECTS;
221
  public static final int MAX_LEVEL;
222
  public static final int MAX_SCRAMBLE;
223
  public static final int MAX_OBJECT_SIZE;
224

    
225
  private final int[] mObjectSizes, mDBLevels, mNumScrambles, mSmallIconIDs, mMediumIconIDs, mBigIconIDs, mHugeIconIDs, mResourceIDs;
226
  private final Class<? extends TwistyObject> mObjectClass;
227
  private final int mRow, mNumSizes;
228

    
229
  private static final ObjectList[] objects;
230
  private static int mNumAll;
231
  private static int[] mIndices;
232
  private static int mColCount, mRowCount;
233

    
234
  static
235
    {
236
    mNumAll = 0;
237
    int num, i = 0;
238
    objects = new ObjectList[NUM_OBJECTS];
239
    int maxNum     = Integer.MIN_VALUE;
240
    int maxLevel   = Integer.MIN_VALUE;
241
    int maxScramble= Integer.MIN_VALUE;
242
    int maxSize    = Integer.MIN_VALUE;
243

    
244
    for(ObjectList object: ObjectList.values())
245
      {
246
      objects[i] = object;
247
      i++;
248
      num = object.mObjectSizes.length;
249
      mNumAll += num;
250
      if( num> maxNum ) maxNum = num;
251

    
252
      for(int j=0; j<num; j++)
253
        {
254
        if( object.mNumScrambles[j]> maxScramble ) maxScramble= object.mNumScrambles[j];
255
        if( object.mDBLevels[j]    > maxLevel    ) maxLevel   = object.mDBLevels[j];
256
        if( object.mObjectSizes[j] > maxSize     ) maxSize    = object.mObjectSizes[j];
257
        }
258
      }
259

    
260
    MAX_NUM_OBJECTS = maxNum;
261
    MAX_LEVEL       = maxLevel;
262
    MAX_SCRAMBLE    = maxScramble;
263
    MAX_OBJECT_SIZE = maxSize;
264
    }
265

    
266
///////////////////////////////////////////////////////////////////////////////////////////////////
267

    
268
  private static void setUpColAndRow()
269
    {
270
    mIndices = new int[NUM_OBJECTS];
271
    mRowCount= 0;
272

    
273
    for(int obj=0; obj<NUM_OBJECTS; obj++)
274
      {
275
      mIndices[obj] = objects[obj].mRow;
276
      if( mIndices[obj]>=mRowCount ) mRowCount = mIndices[obj]+1;
277
      }
278

    
279
    mColCount = 0;
280

    
281
    for(int row=0; row<mRowCount; row++)
282
      {
283
      int numObjects = computeNumObjectsInRow(row);
284
      if( numObjects>mColCount ) mColCount = numObjects;
285
      }
286
    }
287

    
288
///////////////////////////////////////////////////////////////////////////////////////////////////
289

    
290
  private static int computeNumObjectsInRow(int row)
291
    {
292
    int num=0;
293

    
294
    for(int object=0; object<NUM_OBJECTS; object++)
295
      {
296
      if( objects[object].mRow == row )
297
        {
298
        num += objects[object].mNumSizes;
299
        }
300
      }
301

    
302
    return num;
303
    }
304

    
305
///////////////////////////////////////////////////////////////////////////////////////////////////
306

    
307
  public static int getColumnCount()
308
    {
309
    if( mIndices==null ) setUpColAndRow();
310

    
311
    return mColCount;
312
    }
313

    
314
///////////////////////////////////////////////////////////////////////////////////////////////////
315

    
316
  public static int getRowCount()
317
    {
318
    if( mIndices==null ) setUpColAndRow();
319

    
320
    return mRowCount;
321
    }
322

    
323
///////////////////////////////////////////////////////////////////////////////////////////////////
324

    
325
  public static int[] getIndices()
326
    {
327
    if( mIndices==null ) setUpColAndRow();
328

    
329
    return mIndices;
330
    }
331

    
332
///////////////////////////////////////////////////////////////////////////////////////////////////
333

    
334
  public static ObjectList getObject(int ordinal)
335
    {
336
    return ordinal>=0 && ordinal<NUM_OBJECTS ? objects[ordinal] : CUBE;
337
    }
338

    
339
///////////////////////////////////////////////////////////////////////////////////////////////////
340

    
341
  public static int pack(int object, int sizeIndex)
342
    {
343
    int ret = 0;
344
    for(int i=0; i<object; i++) ret += objects[i].mObjectSizes.length;
345

    
346
    return ret+sizeIndex;
347
    }
348

    
349
///////////////////////////////////////////////////////////////////////////////////////////////////
350

    
351
  public static int unpackSizeIndex(int number)
352
    {
353
    int num;
354

    
355
    for(int i=0; i<NUM_OBJECTS; i++)
356
      {
357
      num = objects[i].mObjectSizes.length;
358
      if( number<num ) return number;
359
      number -= num;
360
      }
361

    
362
    return -1;
363
    }
364

    
365
///////////////////////////////////////////////////////////////////////////////////////////////////
366

    
367
  public static int unpackObject(int number)
368
    {
369
    int num;
370

    
371
    for(int i=0; i<NUM_OBJECTS; i++)
372
      {
373
      num = objects[i].mObjectSizes.length;
374
      if( number<num ) return i;
375
      number -= num;
376
      }
377

    
378
    return -1;
379
    }
380

    
381
///////////////////////////////////////////////////////////////////////////////////////////////////
382

    
383
  public static int unpackObjectFromString(String obj)
384
    {
385
    int u = obj.indexOf('_');
386
    int l = obj.length();
387

    
388
    if( u>0 )
389
      {
390
      String name = obj.substring(0,u);
391
      int size = Integer.parseInt( obj.substring(u+1,l) );
392

    
393
      for(int i=0; i<NUM_OBJECTS; i++)
394
        {
395
        if( objects[i].name().equals(name) )
396
          {
397
          int sizeIndex = getSizeIndex(i,size);
398
          return pack(i,sizeIndex);
399
          }
400
        }
401
      }
402

    
403
    return -1;
404
    }
405

    
406
///////////////////////////////////////////////////////////////////////////////////////////////////
407

    
408
  public static String getObjectList()
409
    {
410
    String name;
411
    StringBuilder list = new StringBuilder();
412
    int len;
413
    int[] sizes;
414

    
415
    for(int i=0; i<NUM_OBJECTS; i++)
416
      {
417
      sizes = objects[i].mObjectSizes;
418
      len   = sizes.length;
419
      name  = objects[i].name();
420

    
421
      for(int j=0; j<len; j++)
422
        {
423
        if( i>0 || j>0 ) list.append(',');
424
        list.append(name);
425
        list.append('_');
426
        list.append(sizes[j]);
427
        }
428
      }
429

    
430
    return list.toString();
431
    }
432

    
433
///////////////////////////////////////////////////////////////////////////////////////////////////
434

    
435
  public static int getTotal()
436
    {
437
    return mNumAll;
438
    }
439

    
440
///////////////////////////////////////////////////////////////////////////////////////////////////
441

    
442
  public static int getDBLevel(int ordinal, int sizeIndex)
443
    {
444
    if( ordinal>=0 && ordinal<NUM_OBJECTS )
445
      {
446
      int num = objects[ordinal].mObjectSizes.length;
447
      return sizeIndex>=0 && sizeIndex<num ? objects[ordinal].mDBLevels[sizeIndex] : 0;
448
      }
449

    
450
    return 0;
451
    }
452

    
453
///////////////////////////////////////////////////////////////////////////////////////////////////
454

    
455
  public static int getNumScramble(int ordinal, int sizeIndex)
456
    {
457
    if( ordinal>=0 && ordinal<NUM_OBJECTS )
458
      {
459
      int num = objects[ordinal].mObjectSizes.length;
460
      return sizeIndex>=0 && sizeIndex<num ? objects[ordinal].mNumScrambles[sizeIndex] : 0;
461
      }
462

    
463
    return 0;
464
    }
465

    
466
///////////////////////////////////////////////////////////////////////////////////////////////////
467

    
468
  public static int getOrdinal(String name)
469
    {
470
    for(int i=0; i<NUM_OBJECTS; i++)
471
      {
472
      if(objects[i].name().equals(name)) return i;
473
      }
474

    
475
    return -1;
476
    }
477

    
478
///////////////////////////////////////////////////////////////////////////////////////////////////
479

    
480
  public static int getSizeIndex(int ordinal, int size)
481
    {
482
    if( ordinal>=0 && ordinal<NUM_OBJECTS )
483
      {
484
      int[] sizes = objects[ordinal].getSizes();
485
      int len = sizes.length;
486

    
487
      for(int i=0; i<len; i++)
488
        {
489
        if( sizes[i]==size ) return i;
490
        }
491
      }
492

    
493
    return -1;
494
    }
495

    
496
///////////////////////////////////////////////////////////////////////////////////////////////////
497

    
498
  public static int[] retFaceColors(ObjectList object)
499
    {
500
    Field field;
501
    int[] faceColors=null;
502

    
503
    try
504
      {
505
      field = object.mObjectClass.getDeclaredField("FACE_COLORS");
506
      field.setAccessible(true);
507
      Object obj = field.get(null);
508
      faceColors = (int[]) obj;
509
      }
510
    catch(NoSuchFieldException ex)
511
      {
512
      android.util.Log.e("RubikObjectList", object.mObjectClass.getSimpleName()+": no such field exception getting field: "+ex.getMessage());
513
      }
514
    catch(IllegalAccessException ex)
515
      {
516
      android.util.Log.e("RubikObjectList", object.mObjectClass.getSimpleName()+": illegal access exception getting field: "+ex.getMessage());
517
      }
518

    
519
    return faceColors;
520
    }
521

    
522
///////////////////////////////////////////////////////////////////////////////////////////////////
523

    
524
  ObjectList(int[][] info, Class<? extends TwistyObject> object , int row)
525
    {
526
    mNumSizes = info.length;
527

    
528
    mObjectSizes  = new int[mNumSizes];
529
    mDBLevels     = new int[mNumSizes];
530
    mNumScrambles = new int[mNumSizes];
531
    mResourceIDs  = new int[mNumSizes];
532
    mSmallIconIDs = new int[mNumSizes];
533
    mMediumIconIDs= new int[mNumSizes];
534
    mBigIconIDs   = new int[mNumSizes];
535
    mHugeIconIDs  = new int[mNumSizes];
536

    
537
    for(int i=0; i<mNumSizes; i++)
538
      {
539
      mObjectSizes[i]  = info[i][0];
540
      mDBLevels[i]     = info[i][1];
541
      mNumScrambles[i] = info[i][2];
542
      mResourceIDs[i]  = info[i][3];
543
      mSmallIconIDs[i] = info[i][4];
544
      mMediumIconIDs[i]= info[i][5];
545
      mBigIconIDs[i]   = info[i][6];
546
      mHugeIconIDs[i]  = info[i][7];
547
      }
548

    
549
    mObjectClass= object;
550
    mRow        = row;
551
    }
552

    
553
///////////////////////////////////////////////////////////////////////////////////////////////////
554

    
555
  public int[] getSizes()
556
    {
557
    return mObjectSizes;
558
    }
559

    
560
///////////////////////////////////////////////////////////////////////////////////////////////////
561

    
562
  public int[] getIconIDs()
563
    {
564
    int size = RubikActivity.getDrawableSize();
565

    
566
    switch(size)
567
      {
568
      case 0 : return mSmallIconIDs;
569
      case 1 : return mMediumIconIDs;
570
      case 2 : return mBigIconIDs;
571
      default: return mHugeIconIDs;
572
      }
573
    }
574

    
575
///////////////////////////////////////////////////////////////////////////////////////////////////
576

    
577
  public int[] getResourceIDs()
578
    {
579
    return mResourceIDs;
580
    }
581

    
582
///////////////////////////////////////////////////////////////////////////////////////////////////
583

    
584
  public TwistyObject create(int size, Static4D quat, int[][] moves, Resources res, int scrWidth)
585
    {
586
    DistortedTexture texture = new DistortedTexture();
587
    DistortedEffects effects = new DistortedEffects();
588
    MeshSquare mesh          = new MeshSquare(20,20);   // mesh of the node, not of the cubits
589

    
590
    switch(ordinal())
591
      {
592
      case  0: return new TwistyCube          (size, quat, texture, mesh, effects, moves, res, scrWidth);
593
      case  1: return new TwistyJing          (size, quat, texture, mesh, effects, moves, res, scrWidth);
594
      case  2: return new TwistyPyraminx      (size, quat, texture, mesh, effects, moves, res, scrWidth);
595
      case  3: return new TwistyKilominx      (size, quat, texture, mesh, effects, moves, res, scrWidth);
596
      case  4: return new TwistyMegaminx      (size, quat, texture, mesh, effects, moves, res, scrWidth);
597
      case  5: return new TwistyUltimate      (size, quat, texture, mesh, effects, moves, res, scrWidth);
598
      case  6: return new TwistyDiamond       (size, quat, texture, mesh, effects, moves, res, scrWidth);
599
      case  7: return new TwistyDino6         (size, quat, texture, mesh, effects, moves, res, scrWidth);
600
      case  8: return new TwistyDino4         (size, quat, texture, mesh, effects, moves, res, scrWidth);
601
      case  9: return new TwistyRedi          (size, quat, texture, mesh, effects, moves, res, scrWidth);
602
      case 10: return new TwistyHelicopter    (size, quat, texture, mesh, effects, moves, res, scrWidth);
603
      case 11: return new TwistySkewb         (size, quat, texture, mesh, effects, moves, res, scrWidth);
604
      case 12: return new TwistyIvy           (size, quat, texture, mesh, effects, moves, res, scrWidth);
605
      case 13: return new TwistyRex           (size, quat, texture, mesh, effects, moves, res, scrWidth);
606
      case 14: return new TwistyBandagedFused (size, quat, texture, mesh, effects, moves, res, scrWidth);
607
      case 15: return new TwistyBandaged2Bar  (size, quat, texture, mesh, effects, moves, res, scrWidth);
608
      case 16: return new TwistyBandaged3Plate(size, quat, texture, mesh, effects, moves, res, scrWidth);
609
      case 17: return new TwistyBandagedEvil  (size, quat, texture, mesh, effects, moves, res, scrWidth);
610
      case 18: return new TwistySquare1       (size, quat, texture, mesh, effects, moves, res, scrWidth);
611
      case 19: return new TwistySquare2       (size, quat, texture, mesh, effects, moves, res, scrWidth);
612
      case 20: return new TwistyMirror        (size, quat, texture, mesh, effects, moves, res, scrWidth);
613
      }
614

    
615
    return null;
616
    }
617
  }
(17-17/48)