Project

General

Profile

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

magiccube / src / main / java / org / distorted / objects / ObjectList.java @ 00af5060

1 27a70eae 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 1f9772f3 Leszek Koltunski
package org.distorted.objects;
21 27a70eae Leszek Koltunski
22 ccf9fec5 Leszek Koltunski
import android.content.res.Resources;
23
24 27a70eae Leszek Koltunski
import org.distorted.library.main.DistortedEffects;
25
import org.distorted.library.main.DistortedTexture;
26 efa8aa48 Leszek Koltunski
import org.distorted.library.mesh.MeshSquare;
27 27a70eae Leszek Koltunski
import org.distorted.library.type.Static4D;
28 1f9772f3 Leszek Koltunski
import org.distorted.main.R;
29 f6a9c538 Leszek Koltunski
import org.distorted.main.RubikActivity;
30 27a70eae Leszek Koltunski
31 20931cf6 Leszek Koltunski
import java.lang.reflect.Field;
32
33 27a70eae Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
34
35 9c2f0c91 Leszek Koltunski
public enum ObjectList
36 27a70eae Leszek Koltunski
  {
37 4c0cd600 Leszek Koltunski
  CUBE (
38
         new int[][] {
39 31a9f38d Leszek Koltunski
                       {2 , 12, R.raw.cube2, R.drawable.ui_small_cube2, R.drawable.ui_medium_cube2, R.drawable.ui_big_cube2, R.drawable.ui_huge_cube2} ,
40
                       {3 , 16, R.raw.cube3, R.drawable.ui_small_cube3, R.drawable.ui_medium_cube3, R.drawable.ui_big_cube3, R.drawable.ui_huge_cube3} ,
41
                       {4 , 20, R.raw.cube4, R.drawable.ui_small_cube4, R.drawable.ui_medium_cube4, R.drawable.ui_big_cube4, R.drawable.ui_huge_cube4} ,
42
                       {5 , 24, R.raw.cube5, R.drawable.ui_small_cube5, R.drawable.ui_medium_cube5, R.drawable.ui_big_cube5, R.drawable.ui_huge_cube5}
43 4c0cd600 Leszek Koltunski
                     },
44 9c2f0c91 Leszek Koltunski
         TwistyCube.class,
45 ca3300c3 Leszek Koltunski
         new MovementCube(),
46 db875721 Leszek Koltunski
         0,
47
         60
48 4c0cd600 Leszek Koltunski
       ),
49
50
  PYRA (
51
         new int[][] {
52 31a9f38d Leszek Koltunski
                       {3 , 10, R.raw.pyra3, R.drawable.ui_small_pyra3, R.drawable.ui_medium_pyra3, R.drawable.ui_big_pyra3, R.drawable.ui_huge_pyra3} ,
53
                       {4 , 15, R.raw.pyra4, R.drawable.ui_small_pyra4, R.drawable.ui_medium_pyra4, R.drawable.ui_big_pyra4, R.drawable.ui_huge_pyra4} ,
54
                       {5 , 20, R.raw.pyra5, R.drawable.ui_small_pyra5, R.drawable.ui_medium_pyra5, R.drawable.ui_big_pyra5, R.drawable.ui_huge_pyra5}
55 4c0cd600 Leszek Koltunski
                     },
56 9c2f0c91 Leszek Koltunski
         TwistyPyraminx.class,
57 ca3300c3 Leszek Koltunski
         new MovementPyraminx(),
58 db875721 Leszek Koltunski
         1,
59
         30
60 4c0cd600 Leszek Koltunski
       ),
61 418aa554 Leszek Koltunski
62 ece1b58d Leszek Koltunski
  DIAM (
63
         new int[][] {
64 30fdccf8 Leszek Koltunski
                       {2 , 10, R.raw.diamond, R.drawable.ui_small_diam, R.drawable.ui_medium_diam, R.drawable.ui_big_diam, R.drawable.ui_huge_diam} ,
65 ece1b58d Leszek Koltunski
                     },
66 9c2f0c91 Leszek Koltunski
         TwistyDiamond.class,
67 ca3300c3 Leszek Koltunski
         new MovementDiamond(),
68 db875721 Leszek Koltunski
         1,
69
         60
70 ece1b58d Leszek Koltunski
       ),
71
72 418aa554 Leszek Koltunski
  DINO (
73
         new int[][] {
74 f05807f7 Leszek Koltunski
                       {3 , 10, R.raw.dino, R.drawable.ui_small_dino, R.drawable.ui_medium_dino, R.drawable.ui_big_dino, R.drawable.ui_huge_dino} ,
75 418aa554 Leszek Koltunski
                     },
76 9c2f0c91 Leszek Koltunski
         TwistyDino6.class,
77 ca3300c3 Leszek Koltunski
         new MovementDino(),
78 db875721 Leszek Koltunski
         2,
79
         60
80 eaee1ddc Leszek Koltunski
       ),
81
82
  DIN4 (
83
         new int[][] {
84
                       {3 ,  7, R.raw.dino, R.drawable.ui_small_din4, R.drawable.ui_medium_din4, R.drawable.ui_big_din4, R.drawable.ui_huge_din4} ,
85
                     },
86 9c2f0c91 Leszek Koltunski
         TwistyDino4.class,
87 ca3300c3 Leszek Koltunski
         new MovementDino(),
88 db875721 Leszek Koltunski
         2,
89
         60
90 418aa554 Leszek Koltunski
       ),
91 fb52fae9 Leszek Koltunski
92 b96a79ff Leszek Koltunski
  REDI (
93 ee35e63c Leszek Koltunski
         new int[][] {
94 b96a79ff Leszek Koltunski
                       {3 , 14, R.raw.redi, R.drawable.ui_small_redi, R.drawable.ui_medium_redi, R.drawable.ui_big_redi, R.drawable.ui_huge_redi} ,
95 ee35e63c Leszek Koltunski
                     },
96 b96a79ff Leszek Koltunski
         TwistyRedi.class,
97
         new MovementRedi(),
98 db875721 Leszek Koltunski
         2,
99
         60
100 ee35e63c Leszek Koltunski
       ),
101 68f6046c Leszek Koltunski
102 b96a79ff Leszek Koltunski
  HELI (
103 68f6046c Leszek Koltunski
         new int[][] {
104 b96a79ff Leszek Koltunski
                       {3 , 18, R.raw.heli, R.drawable.ui_small_heli, R.drawable.ui_medium_heli, R.drawable.ui_big_heli, R.drawable.ui_huge_heli} ,
105 68f6046c Leszek Koltunski
                     },
106 b96a79ff Leszek Koltunski
         TwistyHelicopter.class,
107
         new MovementHelicopter(),
108 db875721 Leszek Koltunski
         2,
109
         60
110 3f3ff476 Leszek Koltunski
       ),
111
112
  SKEW (
113
         new int[][] {
114
                       {2 , 11, R.raw.skewb, R.drawable.ui_small_skewb, R.drawable.ui_medium_skewb, R.drawable.ui_big_skewb, R.drawable.ui_huge_skewb} ,
115 e51599f4 Leszek Koltunski
                       {3 , 17, R.raw.skewm, R.drawable.ui_small_skewm, R.drawable.ui_medium_skewm, R.drawable.ui_big_skewm, R.drawable.ui_huge_skewm} ,
116 3f3ff476 Leszek Koltunski
                     },
117
         TwistySkewb.class,
118
         new MovementSkewb(),
119 db875721 Leszek Koltunski
         3,
120
         60
121 68f6046c Leszek Koltunski
       ),
122 49cd8581 Leszek Koltunski
123 bbc6da6c Leszek Koltunski
  IVY  (
124 49cd8581 Leszek Koltunski
         new int[][] {
125 d73de3db Leszek Koltunski
                       {2 , 8, R.raw.ivy, R.drawable.ui_small_ivy, R.drawable.ui_medium_ivy, R.drawable.ui_big_ivy, R.drawable.ui_huge_ivy} ,
126 49cd8581 Leszek Koltunski
                     },
127
         TwistyIvy.class,
128
         new MovementIvy(),
129 db875721 Leszek Koltunski
         3,
130
         60
131 49cd8581 Leszek Koltunski
       ),
132 59b87d56 Leszek Koltunski
133 bbc6da6c Leszek Koltunski
  REX  (
134 59b87d56 Leszek Koltunski
         new int[][] {
135 03aa05d5 Leszek Koltunski
                       {3 , 16, R.raw.rex, R.drawable.ui_small_rex, R.drawable.ui_medium_rex, R.drawable.ui_big_rex, R.drawable.ui_huge_rex} ,
136 59b87d56 Leszek Koltunski
                     },
137
         TwistyRex.class,
138
         new MovementRex(),
139 db875721 Leszek Koltunski
         3,
140
         60
141 59b87d56 Leszek Koltunski
       ),
142 bbc6da6c Leszek Koltunski
143 14fe8a07 Leszek Koltunski
  KILO (
144 bbc6da6c Leszek Koltunski
         new int[][] {
145 fa806818 Leszek Koltunski
                       {3 , 18, R.raw.kilo3, R.drawable.ui_small_kilo3, R.drawable.ui_medium_kilo3, R.drawable.ui_big_kilo3, R.drawable.ui_huge_kilo3} ,
146 bbc6da6c Leszek Koltunski
                     },
147 fa806818 Leszek Koltunski
         TwistyKilominx.class,
148 a64e07d0 Leszek Koltunski
         new MovementMinx(),
149 db875721 Leszek Koltunski
         4,
150
         30
151 a64e07d0 Leszek Koltunski
       ),
152
153
  MEGA (
154
         new int[][] {
155 1e6fb034 Leszek Koltunski
                       {3 , 21, R.raw.mega3, R.drawable.ui_small_mega3, R.drawable.ui_medium_mega3, R.drawable.ui_big_mega3, R.drawable.ui_huge_mega3} ,
156 00af5060 Leszek Koltunski
                       {5 , 35, R.raw.mega5, R.drawable.ui_small_mega5, R.drawable.ui_medium_mega5, R.drawable.ui_big_mega5, R.drawable.ui_huge_mega5} ,
157 a64e07d0 Leszek Koltunski
                     },
158
         TwistyMegaminx.class,
159
         new MovementMinx(),
160 db875721 Leszek Koltunski
         4,
161
         30
162 bbc6da6c Leszek Koltunski
       ),
163 27a70eae Leszek Koltunski
  ;
164
165 4888e97c Leszek Koltunski
  public static final int NUM_OBJECTS = values().length;
166 8cccfb10 Leszek Koltunski
  public static final int MAX_NUM_OBJECTS;
167 8e3898c8 Leszek Koltunski
  public static final int MAX_LEVEL;
168 8cccfb10 Leszek Koltunski
  public static final int MAX_OBJECT_SIZE;
169 4888e97c Leszek Koltunski
170 31a9f38d Leszek Koltunski
  private final int[] mObjectSizes, mMaxLevels, mSmallIconIDs, mMediumIconIDs, mBigIconIDs, mHugeIconIDs, mResourceIDs;
171 9c2f0c91 Leszek Koltunski
  private final Class<? extends TwistyObject> mObjectClass;
172 ca3300c3 Leszek Koltunski
  private final Movement mObjectMovementClass;
173 fa679111 Leszek Koltunski
  private final int mColumn, mNumSizes;
174 db875721 Leszek Koltunski
  private final int mFOV;
175 fa679111 Leszek Koltunski
176 9c2f0c91 Leszek Koltunski
  private static final ObjectList[] objects;
177 4888e97c Leszek Koltunski
  private static int mNumAll;
178 e07c48a2 Leszek Koltunski
  private static int[] mIndices;
179 fa679111 Leszek Koltunski
  private static int mColCount, mRowCount;
180 27a70eae Leszek Koltunski
181
  static
182
    {
183 4888e97c Leszek Koltunski
    mNumAll = 0;
184 8cccfb10 Leszek Koltunski
    int num, i = 0;
185 9c2f0c91 Leszek Koltunski
    objects = new ObjectList[NUM_OBJECTS];
186 8cccfb10 Leszek Koltunski
    int maxNum  = Integer.MIN_VALUE;
187
    int maxLevel= Integer.MIN_VALUE;
188
    int maxSize = Integer.MIN_VALUE;
189 27a70eae Leszek Koltunski
190 9c2f0c91 Leszek Koltunski
    for(ObjectList object: ObjectList.values())
191 27a70eae Leszek Koltunski
      {
192 4888e97c Leszek Koltunski
      objects[i] = object;
193 27a70eae Leszek Koltunski
      i++;
194 8cccfb10 Leszek Koltunski
      num = object.mObjectSizes.length;
195
      mNumAll += num;
196
      if( num> maxNum ) maxNum = num;
197 8e3898c8 Leszek Koltunski
198 8cccfb10 Leszek Koltunski
      for(int j=0; j<num; j++)
199 8e3898c8 Leszek Koltunski
        {
200
        if( object.mMaxLevels[j] > maxLevel ) maxLevel = object.mMaxLevels[j];
201 8cccfb10 Leszek Koltunski
        if( object.mObjectSizes[j] > maxSize) maxSize  = object.mObjectSizes[j];
202 8e3898c8 Leszek Koltunski
        }
203 27a70eae Leszek Koltunski
      }
204 4888e97c Leszek Koltunski
205 8cccfb10 Leszek Koltunski
    MAX_NUM_OBJECTS = maxNum;
206
    MAX_LEVEL       = maxLevel;
207
    MAX_OBJECT_SIZE = maxSize;
208 27a70eae Leszek Koltunski
    }
209
210 e07c48a2 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
211 fa679111 Leszek Koltunski
212
  private static void setUpColAndRow()
213
    {
214
    mIndices = new int[NUM_OBJECTS];
215
    mColCount= 0;
216
217
    for(int obj=0; obj<NUM_OBJECTS; obj++)
218
      {
219
      mIndices[obj] = objects[obj].mColumn;
220
      if( mIndices[obj]>=mColCount ) mColCount = mIndices[obj]+1;
221
      }
222
223
    mRowCount = 0;
224
225
    for(int col=0; col<mColCount; col++)
226
      {
227
      int numObjects = computeNumObjectsInColumn(col);
228
      if( numObjects>mRowCount ) mRowCount = numObjects;
229
      }
230
    }
231
232
///////////////////////////////////////////////////////////////////////////////////////////////////
233
234
  private static int computeNumObjectsInColumn(int column)
235
    {
236
    int num=0;
237
238
    for(int object=0; object<NUM_OBJECTS; object++)
239
      {
240
      if( objects[object].mColumn == column )
241
        {
242
        num += objects[object].mNumSizes;
243
        }
244
      }
245
246
    return num;
247
    }
248
249
///////////////////////////////////////////////////////////////////////////////////////////////////
250
251 e07c48a2 Leszek Koltunski
  public static int getColumnCount()
252
    {
253 fa679111 Leszek Koltunski
    if( mIndices==null ) setUpColAndRow();
254
255
    return mColCount;
256 e07c48a2 Leszek Koltunski
    }
257
258
///////////////////////////////////////////////////////////////////////////////////////////////////
259 fa679111 Leszek Koltunski
260 e07c48a2 Leszek Koltunski
  public static int getRowCount()
261
    {
262 fa679111 Leszek Koltunski
    if( mIndices==null ) setUpColAndRow();
263
264
    return mRowCount;
265 e07c48a2 Leszek Koltunski
    }
266
267
///////////////////////////////////////////////////////////////////////////////////////////////////
268 fa679111 Leszek Koltunski
269 e07c48a2 Leszek Koltunski
  public static int[] getIndices()
270
    {
271 fa679111 Leszek Koltunski
    if( mIndices==null ) setUpColAndRow();
272
273 e07c48a2 Leszek Koltunski
    return mIndices;
274
    }
275
276 27a70eae Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
277
278 9c2f0c91 Leszek Koltunski
  public static ObjectList getObject(int ordinal)
279 27a70eae Leszek Koltunski
    {
280 7ec268b1 Leszek Koltunski
    return ordinal>=0 && ordinal<NUM_OBJECTS ? objects[ordinal] : CUBE;
281 27a70eae Leszek Koltunski
    }
282
283
///////////////////////////////////////////////////////////////////////////////////////////////////
284
285 b498f3f6 Leszek Koltunski
  public static int pack(int object, int sizeIndex)
286 4888e97c Leszek Koltunski
    {
287
    int ret = 0;
288
    for(int i=0; i<object; i++) ret += objects[i].mObjectSizes.length;
289
290 b498f3f6 Leszek Koltunski
    return ret+sizeIndex;
291 4888e97c Leszek Koltunski
    }
292
293
///////////////////////////////////////////////////////////////////////////////////////////////////
294
295 8e3898c8 Leszek Koltunski
  public static int unpackSizeIndex(int number)
296 4888e97c Leszek Koltunski
    {
297
    int num;
298
299
    for(int i=0; i<NUM_OBJECTS; i++)
300
      {
301
      num = objects[i].mObjectSizes.length;
302
      if( number<num ) return number;
303
      number -= num;
304
      }
305
306
    return -1;
307
    }
308
309
///////////////////////////////////////////////////////////////////////////////////////////////////
310
311
  public static int unpackObject(int number)
312 27a70eae Leszek Koltunski
    {
313 4888e97c Leszek Koltunski
    int num;
314
315
    for(int i=0; i<NUM_OBJECTS; i++)
316
      {
317
      num = objects[i].mObjectSizes.length;
318
      if( number<num ) return i;
319
      number -= num;
320
      }
321
322
    return -1;
323
    }
324
325 286d73ae Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
326
327
  public static int unpackObjectFromString(String obj)
328
    {
329
    int u = obj.indexOf('_');
330
    int l = obj.length();
331
332
    if( u>0 )
333
      {
334
      String name = obj.substring(0,u);
335
      int size = Integer.parseInt( obj.substring(u+1,l) );
336
337
      for(int i=0; i<NUM_OBJECTS; i++)
338
        {
339
        if( objects[i].name().equals(name) )
340
          {
341 53f23b64 Leszek Koltunski
          int sizeIndex = getSizeIndex(i,size);
342
          return pack(i,sizeIndex);
343 286d73ae Leszek Koltunski
          }
344
        }
345
      }
346
347
    return -1;
348
    }
349
350
///////////////////////////////////////////////////////////////////////////////////////////////////
351
352
  public static String getObjectList()
353
    {
354
    String name;
355
    StringBuilder list = new StringBuilder();
356
    int len;
357
    int[] sizes;
358
359
    for(int i=0; i<NUM_OBJECTS; i++)
360
      {
361
      sizes = objects[i].mObjectSizes;
362
      len   = sizes.length;
363
      name  = objects[i].name();
364
365
      for(int j=0; j<len; j++)
366
        {
367
        if( i>0 || j>0 ) list.append(',');
368
        list.append(name);
369
        list.append('_');
370
        list.append(sizes[j]);
371
        }
372
      }
373
374
    return list.toString();
375
    }
376
377 4888e97c Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
378
379
  public static int getTotal()
380
    {
381
    return mNumAll;
382
    }
383
384 8e3898c8 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
385
386
  public static int getMaxLevel(int ordinal, int sizeIndex)
387
    {
388
    if( ordinal>=0 && ordinal<NUM_OBJECTS )
389
      {
390
      int num = objects[ordinal].mObjectSizes.length;
391
      return sizeIndex>=0 && sizeIndex<num ? objects[ordinal].mMaxLevels[sizeIndex] : 0;
392
      }
393
394
    return 0;
395
    }
396
397 c86f9f1f Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
398
399
  public static int getOrdinal(String name)
400
    {
401
    for(int i=0; i<NUM_OBJECTS; i++)
402
      {
403
      if(objects[i].name().equals(name)) return i;
404
      }
405
406
    return -1;
407
    }
408
409
///////////////////////////////////////////////////////////////////////////////////////////////////
410
411 53f23b64 Leszek Koltunski
  public static int getSizeIndex(int ordinal, int size)
412 c86f9f1f Leszek Koltunski
    {
413 7ec268b1 Leszek Koltunski
    if( ordinal>=0 && ordinal<NUM_OBJECTS )
414 c86f9f1f Leszek Koltunski
      {
415 7ec268b1 Leszek Koltunski
      int[] sizes = objects[ordinal].getSizes();
416
      int len = sizes.length;
417
418
      for(int i=0; i<len; i++)
419
        {
420
        if( sizes[i]==size ) return i;
421
        }
422 c86f9f1f Leszek Koltunski
      }
423
424
    return -1;
425
    }
426
427 4888e97c Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
428
429 9c2f0c91 Leszek Koltunski
  public static int[] retFaceColors(ObjectList object)
430 20931cf6 Leszek Koltunski
    {
431
    Field field;
432
    int[] faceColors=null;
433
434
    try
435
      {
436
      field = object.mObjectClass.getDeclaredField("FACE_COLORS");
437
      field.setAccessible(true);
438
      Object obj = field.get(null);
439
      faceColors = (int[]) obj;
440
      }
441
    catch(NoSuchFieldException ex)
442
      {
443
      android.util.Log.e("RubikObjectList", object.mObjectClass.getSimpleName()+": no such field exception getting field: "+ex.getMessage());
444
      }
445
    catch(IllegalAccessException ex)
446
      {
447
      android.util.Log.e("RubikObjectList", object.mObjectClass.getSimpleName()+": illegal access exception getting field: "+ex.getMessage());
448
      }
449
450
    return faceColors;
451
    }
452
453
///////////////////////////////////////////////////////////////////////////////////////////////////
454
455 db875721 Leszek Koltunski
  ObjectList(int[][] info, Class<? extends TwistyObject> object , Movement movement, int column, int fov)
456 4888e97c Leszek Koltunski
    {
457 fa679111 Leszek Koltunski
    mNumSizes = info.length;
458 ea6ee91b Leszek Koltunski
459 fa679111 Leszek Koltunski
    mObjectSizes  = new int[mNumSizes];
460
    mMaxLevels    = new int[mNumSizes];
461
    mResourceIDs  = new int[mNumSizes];
462
    mSmallIconIDs = new int[mNumSizes];
463
    mMediumIconIDs= new int[mNumSizes];
464
    mBigIconIDs   = new int[mNumSizes];
465
    mHugeIconIDs  = new int[mNumSizes];
466 ea6ee91b Leszek Koltunski
467 fa679111 Leszek Koltunski
    for(int i=0; i<mNumSizes; i++)
468 ea6ee91b Leszek Koltunski
      {
469 f6a9c538 Leszek Koltunski
      mObjectSizes[i]  = info[i][0];
470
      mMaxLevels[i]    = info[i][1];
471
      mResourceIDs[i]  = info[i][2];
472
      mSmallIconIDs[i] = info[i][3];
473
      mMediumIconIDs[i]= info[i][4];
474
      mBigIconIDs[i]   = info[i][5];
475 31a9f38d Leszek Koltunski
      mHugeIconIDs[i]  = info[i][6];
476 ea6ee91b Leszek Koltunski
      }
477
478 20931cf6 Leszek Koltunski
    mObjectClass         = object;
479 27a70eae Leszek Koltunski
    mObjectMovementClass = movement;
480 fa679111 Leszek Koltunski
    mColumn              = column;
481 db875721 Leszek Koltunski
    mFOV                 = fov;
482 27a70eae Leszek Koltunski
    }
483
484
///////////////////////////////////////////////////////////////////////////////////////////////////
485
486 8e3898c8 Leszek Koltunski
  public int[] getSizes()
487 27a70eae Leszek Koltunski
    {
488 8e3898c8 Leszek Koltunski
    return mObjectSizes;
489 27a70eae Leszek Koltunski
    }
490
491
///////////////////////////////////////////////////////////////////////////////////////////////////
492
493 8e3898c8 Leszek Koltunski
  public int[] getMaxLevels()
494 4888e97c Leszek Koltunski
    {
495 8e3898c8 Leszek Koltunski
    return mMaxLevels;
496
    }
497
498 db875721 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
499
500
  public int getFOV()
501
    {
502
    return mFOV;
503
    }
504
505 8e3898c8 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
506
507
  public int[] getIconIDs()
508
    {
509 f6a9c538 Leszek Koltunski
    int size = RubikActivity.getDrawableSize();
510
511
    switch(size)
512
      {
513
      case 0 : return mSmallIconIDs;
514
      case 1 : return mMediumIconIDs;
515 31a9f38d Leszek Koltunski
      case 2 : return mBigIconIDs;
516
      default: return mHugeIconIDs;
517 f6a9c538 Leszek Koltunski
      }
518 4888e97c Leszek Koltunski
    }
519
520
///////////////////////////////////////////////////////////////////////////////////////////////////
521
522 ccf9fec5 Leszek Koltunski
  public int[] getResourceIDs()
523
    {
524
    return mResourceIDs;
525
    }
526
527 fbca0033 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
528
529
  public int getNumVariants()
530
    {
531
    return mObjectSizes.length;
532
    }
533
534 ccf9fec5 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
535
536 9c2f0c91 Leszek Koltunski
  public TwistyObject create(int size, Static4D quat, int[][] moves, Resources res, int scrWidth)
537 27a70eae Leszek Koltunski
    {
538 5974d2ae Leszek Koltunski
    DistortedTexture texture = new DistortedTexture();
539 36273130 Leszek Koltunski
    DistortedEffects effects = new DistortedEffects();
540 fb52fae9 Leszek Koltunski
    MeshSquare mesh          = new MeshSquare(20,20);   // mesh of the node, not of the cubits
541 74686c71 Leszek Koltunski
542 4888e97c Leszek Koltunski
    switch(ordinal())
543
      {
544 bbc6da6c Leszek Koltunski
      case  0: return new TwistyCube      (size, quat, texture, mesh, effects, moves, res, scrWidth);
545
      case  1: return new TwistyPyraminx  (size, quat, texture, mesh, effects, moves, res, scrWidth);
546
      case  2: return new TwistyDiamond   (size, quat, texture, mesh, effects, moves, res, scrWidth);
547
      case  3: return new TwistyDino6     (size, quat, texture, mesh, effects, moves, res, scrWidth);
548
      case  4: return new TwistyDino4     (size, quat, texture, mesh, effects, moves, res, scrWidth);
549
      case  5: return new TwistyRedi      (size, quat, texture, mesh, effects, moves, res, scrWidth);
550
      case  6: return new TwistyHelicopter(size, quat, texture, mesh, effects, moves, res, scrWidth);
551
      case  7: return new TwistySkewb     (size, quat, texture, mesh, effects, moves, res, scrWidth);
552
      case  8: return new TwistyIvy       (size, quat, texture, mesh, effects, moves, res, scrWidth);
553
      case  9: return new TwistyRex       (size, quat, texture, mesh, effects, moves, res, scrWidth);
554 fa806818 Leszek Koltunski
      case 10: return new TwistyKilominx  (size, quat, texture, mesh, effects, moves, res, scrWidth);
555 a64e07d0 Leszek Koltunski
      case 11: return new TwistyMegaminx  (size, quat, texture, mesh, effects, moves, res, scrWidth);
556 4888e97c Leszek Koltunski
      }
557
558
    return null;
559 27a70eae Leszek Koltunski
    }
560
561
///////////////////////////////////////////////////////////////////////////////////////////////////
562
563 ca3300c3 Leszek Koltunski
  public Movement getObjectMovementClass()
564 27a70eae Leszek Koltunski
    {
565 4888e97c Leszek Koltunski
    return mObjectMovementClass;
566 27a70eae Leszek Koltunski
    }
567
  }