Project

General

Profile

Download (18.9 KB) Statistics
| Branch: | Revision:

distorted-objectlib / src / main / java / org / distorted / objectlib / objects / TwistyDiamond.java @ 19e04479

1 29b82486 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.objectlib.objects;
21
22 c9c71c3f Leszek Koltunski
import static org.distorted.objectlib.touchcontrol.TouchControl.TC_OCTAHEDRON;
23
import static org.distorted.objectlib.touchcontrol.TouchControl.TYPE_NOT_SPLIT;
24 29b82486 Leszek Koltunski
25 82eb152a Leszek Koltunski
import java.io.InputStream;
26 29b82486 Leszek Koltunski
27
import org.distorted.library.type.Static3D;
28
import org.distorted.library.type.Static4D;
29
30 3ee1d662 Leszek Koltunski
import org.distorted.objectlib.helpers.ObjectFaceShape;
31 1d581993 Leszek Koltunski
import org.distorted.objectlib.helpers.ObjectSignature;
32 c9c71c3f Leszek Koltunski
import org.distorted.objectlib.touchcontrol.TouchControlOctahedron;
33 8005e762 Leszek Koltunski
import org.distorted.objectlib.main.ObjectType;
34 198c5bf0 Leszek Koltunski
import org.distorted.objectlib.helpers.ObjectShape;
35 10b7e306 Leszek Koltunski
import org.distorted.objectlib.scrambling.ScrambleState;
36 386af988 Leszek Koltunski
import org.distorted.objectlib.main.ShapeOctahedron;
37 29b82486 Leszek Koltunski
38
///////////////////////////////////////////////////////////////////////////////////////////////////
39
40 386af988 Leszek Koltunski
public class TwistyDiamond extends ShapeOctahedron
41 29b82486 Leszek Koltunski
{
42
  // the four rotation axis of a Diamond. Must be normalized.
43
  static final Static3D[] ROT_AXIS = new Static3D[]
44
         {
45
           new Static3D(+SQ6/3,+SQ3/3,     0),
46
           new Static3D(-SQ6/3,+SQ3/3,     0),
47
           new Static3D(     0,-SQ3/3,-SQ6/3),
48
           new Static3D(     0,-SQ3/3,+SQ6/3)
49
         };
50
51
  private ScrambleState[] mStates;
52 beee90ab Leszek Koltunski
  private int[][] mBasicAngle;
53 29b82486 Leszek Koltunski
  private float[][] mCuts;
54
  private int[] mTetraToFaceMap;
55 35ae98f0 Leszek Koltunski
  private float[][] mPosition;
56 29b82486 Leszek Koltunski
57
///////////////////////////////////////////////////////////////////////////////////////////////////
58
59 3bf19410 Leszek Koltunski
  public TwistyDiamond(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
60 29b82486 Leszek Koltunski
    {
61 3bf19410 Leszek Koltunski
    super(numL, meshState, iconMode, numL[0], quat, move, scale, stream);
62 29b82486 Leszek Koltunski
    }
63
64
///////////////////////////////////////////////////////////////////////////////////////////////////
65
66 f9a81f52 Leszek Koltunski
  public ScrambleState[] getScrambleStates()
67 29b82486 Leszek Koltunski
    {
68
    if( mStates==null )
69
      {
70 a57e6870 Leszek Koltunski
      int[] numLayers = getNumLayers();
71
      int numL = numLayers[0];
72
      int[] tmp = new int[3*2*numL];
73 29b82486 Leszek Koltunski
74 a57e6870 Leszek Koltunski
      for(int i=0; i<2*numL; i++)
75 29b82486 Leszek Koltunski
        {
76 a57e6870 Leszek Koltunski
        tmp[3*i  ] = (i<numL) ?  i:i-numL;
77 29b82486 Leszek Koltunski
        tmp[3*i+1] = (i%2==0) ? -1:1;
78
        tmp[3*i+2] = 0;
79
        }
80
81
      mStates = new ScrambleState[]
82
        {
83
        new ScrambleState( new int[][] {tmp,tmp,tmp,tmp} )
84
        };
85
      }
86
87
    return mStates;
88
    }
89
90
///////////////////////////////////////////////////////////////////////////////////////////////////
91
92 7bbfc84f Leszek Koltunski
  public float[][] getCuts(int[] numLayers)
93 29b82486 Leszek Koltunski
    {
94 a57e6870 Leszek Koltunski
    int numL = numLayers[0];
95
    if( numL<2 ) return null;
96 29b82486 Leszek Koltunski
97
    if( mCuts==null )
98
      {
99 a57e6870 Leszek Koltunski
      mCuts = new float[4][numL-1];
100
      float cut = (SQ6/6)*(2-numL);
101 29b82486 Leszek Koltunski
102 a57e6870 Leszek Koltunski
      for(int i=0; i<numL-1; i++)
103 29b82486 Leszek Koltunski
        {
104
        mCuts[0][i] = cut;
105
        mCuts[1][i] = cut;
106
        mCuts[2][i] = cut;
107
        mCuts[3][i] = cut;
108
        cut += SQ6/3;
109
        }
110
      }
111
112
    return mCuts;
113
    }
114
115
///////////////////////////////////////////////////////////////////////////////////////////////////
116
117 59c20632 Leszek Koltunski
  public boolean[][] getLayerRotatable(int[] numLayers)
118 29b82486 Leszek Koltunski
    {
119 59c20632 Leszek Koltunski
    int numAxis = ROT_AXIS.length;
120
    boolean[][] layerRotatable = new boolean[numAxis][];
121 a57e6870 Leszek Koltunski
122 59c20632 Leszek Koltunski
    for(int i=0; i<numAxis; i++)
123
      {
124
      layerRotatable[i] = new boolean[numLayers[i]];
125
      for(int j=0; j<numLayers[i]; j++) layerRotatable[i][j] = true;
126 29b82486 Leszek Koltunski
      }
127 59c20632 Leszek Koltunski
128
    return layerRotatable;
129
    }
130
131
///////////////////////////////////////////////////////////////////////////////////////////////////
132
133 11fa413d Leszek Koltunski
  public int getTouchControlType()
134 59c20632 Leszek Koltunski
    {
135 c9c71c3f Leszek Koltunski
    return TC_OCTAHEDRON;
136 59c20632 Leszek Koltunski
    }
137
138
///////////////////////////////////////////////////////////////////////////////////////////////////
139
140 11fa413d Leszek Koltunski
  public int getTouchControlSplit()
141 59c20632 Leszek Koltunski
    {
142
    return TYPE_NOT_SPLIT;
143
    }
144
145
///////////////////////////////////////////////////////////////////////////////////////////////////
146
147
  public int[][][] getEnabled()
148
    {
149
    return new int[][][]
150
      {
151
          {{1,2,3}},{{1,2,3}},{{0,2,3}},{{0,2,3}},{{0,1,3}},{{0,1,3}},{{0,1,2}},{{0,1,2}}
152
      };
153
    }
154
155
///////////////////////////////////////////////////////////////////////////////////////////////////
156
157
  public float[] getDist3D(int[] numLayers)
158
    {
159 4c9ca251 Leszek Koltunski
    return TouchControlOctahedron.D3D;
160
    }
161
162
///////////////////////////////////////////////////////////////////////////////////////////////////
163
164
  public Static3D[] getFaceAxis()
165
    {
166
    return TouchControlOctahedron.FACE_AXIS;
167 29b82486 Leszek Koltunski
    }
168
169
///////////////////////////////////////////////////////////////////////////////////////////////////
170
171
  private int getNumOctahedrons(int layers)
172
    {
173
    return layers==1 ? 1 : 4*(layers-1)*(layers-1) + 2;
174
    }
175
176
///////////////////////////////////////////////////////////////////////////////////////////////////
177
178
  private int getNumTetrahedrons(int layers)
179
    {
180
    return 4*layers*(layers-1);
181
    }
182
183
///////////////////////////////////////////////////////////////////////////////////////////////////
184
185
  private int createOctaPositions(float[][] centers, int index, int layers, float height)
186
    {
187
    float x = (layers-1)*0.5f;
188
    float z = (layers+1)*0.5f;
189
190
    for(int i=0; i<layers; i++, index++)
191
      {
192
      z -= 1;
193
      centers[index][0] = x;
194
      centers[index][1] = height;
195
      centers[index][2] = z;
196
      }
197
198
    for(int i=0; i<layers-1; i++, index++)
199
      {
200
      x -= 1;
201
      centers[index][0] = x;
202
      centers[index][1] = height;
203
      centers[index][2] = z;
204
      }
205
206
    for(int i=0; i<layers-1; i++, index++)
207
      {
208
      z += 1;
209
      centers[index][0] = x;
210
      centers[index][1] = height;
211
      centers[index][2] = z;
212
      }
213
214
    for(int i=0; i<layers-2; i++, index++)
215
      {
216
      x += 1;
217
      centers[index][0] = x;
218
      centers[index][1] = height;
219
      centers[index][2] = z;
220
      }
221
222
    return index;
223
    }
224
225
///////////////////////////////////////////////////////////////////////////////////////////////////
226
227
  private int createTetraPositions(float[][] centers, int index, int layers, float height)
228
    {
229
    float x = (layers-1)*0.5f;
230
    float z =  layers*0.5f;
231
232
    for(int i=0; i<layers-1; i++, index++)
233
      {
234
      z -= 1;
235
      centers[index][0] = x;
236
      centers[index][1] = height;
237
      centers[index][2] = z;
238
      }
239
240
    x += 0.5f;
241
    z -= 0.5f;
242
243
    for(int i=0; i<layers-1; i++, index++)
244
      {
245
      x -= 1;
246
      centers[index][0] = x;
247
      centers[index][1] = height;
248
      centers[index][2] = z;
249
      }
250
251
    x -= 0.5f;
252
    z -= 0.5f;
253
254
    for(int i=0; i<layers-1; i++, index++)
255
      {
256
      z += 1;
257
      centers[index][0] = x;
258
      centers[index][1] = height;
259
      centers[index][2] = z;
260
      }
261
262
    x -= 0.5f;
263
    z += 0.5f;
264
265
    for(int i=0; i<layers-1; i++, index++)
266
      {
267
      x += 1;
268
      centers[index][0] = x;
269
      centers[index][1] = height;
270
      centers[index][2] = z;
271
      }
272
273
    return index;
274
    }
275
276
///////////////////////////////////////////////////////////////////////////////////////////////////
277
278 7b832206 Leszek Koltunski
  public float[][] getCubitPositions(int[] numLayers)
279 29b82486 Leszek Koltunski
    {
280 35ae98f0 Leszek Koltunski
    if( mPosition==null )
281
      {
282
      int layers = numLayers[0];
283
      int numO = getNumOctahedrons(layers);
284
      int numT = getNumTetrahedrons(layers);
285
      int index = 0;
286
      float height = 0.0f;
287 29b82486 Leszek Koltunski
288 35ae98f0 Leszek Koltunski
      mPosition = new float[numO+numT][3];
289 29b82486 Leszek Koltunski
290 35ae98f0 Leszek Koltunski
      index = createOctaPositions(mPosition,index,layers,height);
291 29b82486 Leszek Koltunski
292 35ae98f0 Leszek Koltunski
      for(int i=layers-1; i>0; i--)
293
        {
294
        height += SQ2/2;
295
        index = createOctaPositions(mPosition,index,i,+height);
296
        index = createOctaPositions(mPosition,index,i,-height);
297
        }
298 29b82486 Leszek Koltunski
299 35ae98f0 Leszek Koltunski
      height = SQ2/4;
300 29b82486 Leszek Koltunski
301 35ae98f0 Leszek Koltunski
      for(int i=layers; i>1; i--)
302
        {
303
        index = createTetraPositions(mPosition,index,i,+height);
304
        index = createTetraPositions(mPosition,index,i,-height);
305
        height += SQ2/2;
306
        }
307 29b82486 Leszek Koltunski
      }
308
309 35ae98f0 Leszek Koltunski
    return mPosition;
310 29b82486 Leszek Koltunski
    }
311
312 d0e6cf7f Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
313
314
  public Static4D getCubitQuats(int cubit, int[] numLayers)
315
    {
316
    int numL = numLayers[0];
317
    int numO = getNumOctahedrons(numL);
318
319 802fe251 Leszek Koltunski
    if( cubit<numO ) return mObjectQuats[0];
320 d0e6cf7f Leszek Koltunski
321
    switch( retFaceTetraBelongsTo(cubit-numO, numL) )
322
      {
323 802fe251 Leszek Koltunski
      case 0: return mObjectQuats[0];                   // unit quat
324 d0e6cf7f Leszek Koltunski
      case 1: return new Static4D(0,-SQ2/2,0,SQ2/2);    //  90 along Y
325 802fe251 Leszek Koltunski
      case 2: return mObjectQuats[10];                  // 180 along Y
326 d0e6cf7f Leszek Koltunski
      case 3: return new Static4D(0,+SQ2/2,0,SQ2/2);    //  90 along
327
      case 4: return new Static4D(0,     0,1,    0);    // 180 along Z
328 35ae98f0 Leszek Koltunski
      case 5: return mObjectQuats[4];
329 d0e6cf7f Leszek Koltunski
      case 6: return new Static4D(     1,0,0,    0);    // 180 along X
330 35ae98f0 Leszek Koltunski
      case 7: return mObjectQuats[3];
331 d0e6cf7f Leszek Koltunski
      }
332
333
    return null;
334
    }
335
336 29b82486 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
337
338
  private int retFaceTetraBelongsTo(int tetra, int numLayers)
339
    {
340
    if( mTetraToFaceMap==null ) mTetraToFaceMap = new int[] {1,2,3,0,5,6,7,4};
341
342
    for(int i=numLayers-1; i>0; i--)
343
      {
344
      if( tetra < 8*i ) return mTetraToFaceMap[tetra/i];
345
      tetra -= 8*i;
346
      }
347
348
    return -1;
349
    }
350
351
///////////////////////////////////////////////////////////////////////////////////////////////////
352
353 e30c522a Leszek Koltunski
  public ObjectShape getObjectShape(int variant)
354 29b82486 Leszek Koltunski
    {
355
    if( variant==0 )
356
      {
357 4e9f2df5 Leszek Koltunski
      float[][] vertices =
358 29b82486 Leszek Koltunski
          {
359 57ef6378 Leszek Koltunski
             { 0.5f,  0.0f, 0.5f},
360
             { 0.5f,  0.0f,-0.5f},
361
             {-0.5f,  0.0f,-0.5f},
362
             {-0.5f,  0.0f, 0.5f},
363
             { 0.0f, SQ2/2, 0.0f},
364
             { 0.0f,-SQ2/2, 0.0f}
365 29b82486 Leszek Koltunski
          };
366
367 4e9f2df5 Leszek Koltunski
      int[][] indices =
368 29b82486 Leszek Koltunski
          {
369
             {3,0,4},
370
             {0,1,4},
371
             {1,2,4},
372
             {2,3,4},
373
             {5,0,3},
374
             {5,1,0},
375
             {5,2,1},
376
             {5,3,2}
377
          };
378
379 59a971c1 Leszek Koltunski
      return new ObjectShape(vertices, indices);
380 3ee1d662 Leszek Koltunski
      }
381
    else
382
      {
383 4e9f2df5 Leszek Koltunski
      float[][] vertices= { {-0.5f, SQ2/4, 0.0f}, { 0.5f, SQ2/4, 0.0f}, { 0.0f,-SQ2/4, 0.5f}, { 0.0f,-SQ2/4,-0.5f} };
384
      int[][] indices   = { {2,1,0}, {2,3,1}, {3,2,0}, {3,0,1} };
385 59a971c1 Leszek Koltunski
      return new ObjectShape(vertices, indices);
386 3ee1d662 Leszek Koltunski
      }
387
    }
388
389
///////////////////////////////////////////////////////////////////////////////////////////////////
390
391
  public ObjectFaceShape getObjectFaceShape(int variant)
392
    {
393
    int numL = getNumLayers()[0];
394
    int N = numL>3 ? 5:6;
395 4e9f2df5 Leszek Koltunski
    int E = numL>2 ? (numL>3 ? 0:1) : 2;
396 3bf19410 Leszek Koltunski
    float height = isInIconMode() ? 0.001f : 0.05f;
397 3ee1d662 Leszek Koltunski
398
    if( variant==0 )
399
      {
400 3bf19410 Leszek Koltunski
      float[][] bands     = { {height,20,0.5f,0.8f,N,E,E} };
401 4e9f2df5 Leszek Koltunski
      int[] bandIndices   = { 0,0,0,0,0,0,0,0 };
402
      float[][] corners   = { {0.04f,0.20f} };
403
      int[] cornerIndices = { 0,0,0,0,0,0 };
404
      float[][] centers   = { {0.0f, 0.0f, 0.0f} };
405
      int[] centerIndices = { 0,0,0,0,0,0 };
406 3ee1d662 Leszek Koltunski
      return new ObjectFaceShape(bands,bandIndices,corners,cornerIndices,centers,centerIndices,null);
407 29b82486 Leszek Koltunski
      }
408
    else
409
      {
410 3bf19410 Leszek Koltunski
      float[][] bands     = { {height,35,0.5f,0.8f,N,E,E} };
411 4e9f2df5 Leszek Koltunski
      int[] bandIndices   = { 0,0,0,0 };
412
      float[][] corners   = { {0.08f,0.15f} };
413
      int[] cornerIndices = { 0,0,0,0 };
414
      float[][] centers   = { {0.0f, 0.0f, 0.0f} };
415
      int[] centerIndices = { 0,0,0,0 };
416 3ee1d662 Leszek Koltunski
      return new ObjectFaceShape(bands,bandIndices,corners,cornerIndices,centers,centerIndices,null);
417 29b82486 Leszek Koltunski
      }
418
    }
419
420
///////////////////////////////////////////////////////////////////////////////////////////////////
421
422 e30c522a Leszek Koltunski
  public int getNumCubitVariants(int[] numLayers)
423 29b82486 Leszek Koltunski
    {
424
    return 2;
425
    }
426
427
///////////////////////////////////////////////////////////////////////////////////////////////////
428
429 e30c522a Leszek Koltunski
  public int getCubitVariant(int cubit, int[] numLayers)
430 29b82486 Leszek Koltunski
    {
431 a57e6870 Leszek Koltunski
    return cubit<getNumOctahedrons(numLayers[0]) ? 0 : 1;
432 29b82486 Leszek Koltunski
    }
433
434 3d766df3 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
435
436 d53fb890 Leszek Koltunski
  public float getStickerRadius()
437 3d766df3 Leszek Koltunski
    {
438 00f4980d Leszek Koltunski
    return 0.08f;
439 3d766df3 Leszek Koltunski
    }
440
441
///////////////////////////////////////////////////////////////////////////////////////////////////
442
443 d53fb890 Leszek Koltunski
  public float getStickerStroke()
444 3d766df3 Leszek Koltunski
    {
445
    float stroke = 0.08f;
446
447 3bf19410 Leszek Koltunski
    if( isInIconMode() )
448 3d766df3 Leszek Koltunski
      {
449
      int[] numLayers = getNumLayers();
450
451
      switch(numLayers[0])
452
        {
453
        case 2: stroke*=1.4f; break;
454
        case 3: stroke*=2.0f; break;
455
        case 4: stroke*=2.1f; break;
456
        default:stroke*=2.2f; break;
457
        }
458
      }
459
460
    return stroke;
461
    }
462
463 00f4980d Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
464
465 d53fb890 Leszek Koltunski
  public float[][] getStickerAngles()
466 00f4980d Leszek Koltunski
    {
467
    return null;
468
    }
469 29b82486 Leszek Koltunski
470
///////////////////////////////////////////////////////////////////////////////////////////////////
471
// PUBLIC API
472
473
  public Static3D[] getRotationAxis()
474
    {
475
    return ROT_AXIS;
476
    }
477
478
///////////////////////////////////////////////////////////////////////////////////////////////////
479
480 beee90ab Leszek Koltunski
  public int[][] getBasicAngles()
481 29b82486 Leszek Koltunski
    {
482 beee90ab Leszek Koltunski
    if( mBasicAngle ==null )
483
      {
484
      int num = getNumLayers()[0];
485
      int[] tmp = new int[num];
486
      for(int i=0; i<num; i++) tmp[i] = 3;
487
      mBasicAngle = new int[][] { tmp,tmp,tmp,tmp };
488
      }
489 29b82486 Leszek Koltunski
    return mBasicAngle;
490
    }
491
492 61aa85e4 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
493
494 5f54927b Leszek Koltunski
  public String getShortName()
495 61aa85e4 Leszek Koltunski
    {
496 5f54927b Leszek Koltunski
    switch(getNumLayers()[0])
497
      {
498
      case 2: return ObjectType.DIAM_2.name();
499
      case 3: return ObjectType.DIAM_3.name();
500
      case 4: return ObjectType.DIAM_4.name();
501
      }
502
503
    return ObjectType.DIAM_2.name();
504
    }
505
506
///////////////////////////////////////////////////////////////////////////////////////////////////
507
508 1d581993 Leszek Koltunski
  public ObjectSignature getSignature()
509 5f54927b Leszek Koltunski
    {
510
    switch(getNumLayers()[0])
511 61aa85e4 Leszek Koltunski
      {
512 1d581993 Leszek Koltunski
      case 2: return new ObjectSignature(ObjectType.DIAM_2);
513
      case 3: return new ObjectSignature(ObjectType.DIAM_3);
514
      case 4: return new ObjectSignature(ObjectType.DIAM_4);
515 61aa85e4 Leszek Koltunski
      }
516
517 1d581993 Leszek Koltunski
    return null;
518 61aa85e4 Leszek Koltunski
    }
519
520 29b82486 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
521
522 e26eb4e7 Leszek Koltunski
  public String getObjectName()
523 29b82486 Leszek Koltunski
    {
524 e26eb4e7 Leszek Koltunski
    switch(getNumLayers()[0])
525 29b82486 Leszek Koltunski
      {
526 e26eb4e7 Leszek Koltunski
      case 2: return "Skewb Diamond";
527
      case 3: return "Face Turning Octahedron";
528
      case 4: return "Master Face Turning Octahedron";
529 29b82486 Leszek Koltunski
      }
530
531 e26eb4e7 Leszek Koltunski
    return "Skewb Diamond";
532 29b82486 Leszek Koltunski
    }
533
534
///////////////////////////////////////////////////////////////////////////////////////////////////
535
536 e26eb4e7 Leszek Koltunski
  public String getInventor()
537 29b82486 Leszek Koltunski
    {
538 e26eb4e7 Leszek Koltunski
    switch(getNumLayers()[0])
539 29b82486 Leszek Koltunski
      {
540 e26eb4e7 Leszek Koltunski
      case 2: return "Uwe Meffert";
541
      case 3: return "David Pitcher";
542
      case 4: return "Timur Evbatyrov";
543 29b82486 Leszek Koltunski
      }
544
545 e26eb4e7 Leszek Koltunski
    return "Uwe Meffert";
546 29b82486 Leszek Koltunski
    }
547
548 59c20632 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
549
550 e26eb4e7 Leszek Koltunski
  public int getYearOfInvention()
551 59c20632 Leszek Koltunski
    {
552 e26eb4e7 Leszek Koltunski
    switch(getNumLayers()[0])
553 59c20632 Leszek Koltunski
      {
554
      case 2: return 1984;
555
      case 3: return 2003;
556
      case 4: return 2011;
557
      }
558
    return 1984;
559
    }
560
561 29b82486 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
562
563 e26eb4e7 Leszek Koltunski
  public int getComplexity()
564 29b82486 Leszek Koltunski
    {
565 e26eb4e7 Leszek Koltunski
    switch(getNumLayers()[0])
566 29b82486 Leszek Koltunski
      {
567 b4223a92 Leszek Koltunski
      case 2: return 1;
568 577fcf3d Leszek Koltunski
      case 3: return 3;
569
      case 4: return 4;
570 29b82486 Leszek Koltunski
      }
571
572
    return 0;
573
    }
574 052e0362 Leszek Koltunski
575
///////////////////////////////////////////////////////////////////////////////////////////////////
576
577
  public String[][] getTutorials()
578
    {
579
    int[] numLayers = getNumLayers();
580
581
    switch(numLayers[0])
582
      {
583
      case 2: return new String[][] {
584
                          {"gb","R2wrbJJ3izM","How to Solve a Skewb Diamond","Dr. Penguin^3"},
585
                          {"es","2RCusYQdYYE","Como resolver Skewb Diamond","Tutoriales Rubik"},
586
                          {"ru","k8B6RFcNoGw","Как собрать Skewb Diamond","Алексей Ярыгин"},
587
                          {"fr","tqbkgwNcZCE","Comment résoudre le Skewb Diamond","Valentino Cube"},
588
                          {"de","6ewzrCOnZfg","Octagon lösen","JamesKnopf"},
589
                          {"pl","61_Z4TpLMBc","Diamond Skewb TUTORIAL PL","MrUk"},
590
                          {"br","UapwpXMYtH4","Como resolver o Octaedro Diamond","Rafael Cinoto"},
591
                          {"kr","hVBSlfHVTME","공식 하나만 사용 - 다이아몬드 스큐브","Denzel Washington"},
592
                         };
593
      case 3: return new String[][] {
594
                          {"gb","n_mBSUDLUZw","Face Turning Octahedron Tutorial","SuperAntoniovivaldi"},
595
                          {"es","ogf0t6fGxZI","FTO - Tutorial en español","Gadi Rubik"},
596
                          {"ru","VXCjk0bVRoA","Как собрать Face Turning Octahedron","Алексей Ярыгин"},
597
                          {"de","6bO0AcwY5K8","Face Turning Octahedron - Tutorial","GerCubing"},
598
                          {"pl","huWg-ZfP-KY","Octahedron cube TUTORIAL PL","MrUk"},
599
                          {"br","WN3BoP4EbvM","Como resolver o octaedro 3x3 1/3","Rafael Cinoto"},
600
                          {"br","4zFlfANOliE","Como resolver o octaedro 3x3 2/3","Rafael Cinoto"},
601
                          {"br","6OvNzoHk7RU","Como resolver o octaedro 3x3 3/3","Rafael Cinoto"},
602 a399e91b Leszek Koltunski
                          {"vn","KzGQ-mVRsss","Tutorial N.43 - FTO","Duy Thích Rubik"},
603 052e0362 Leszek Koltunski
                         };
604
      case 4: return new String[][] {
605
                          {"gb","3GJkySk5zeQ","Master Face Turning Octahedron","SuperAntoniovivaldi"},
606
                          {"gb","zW_1htxy52k","Master FTO Tutorial","Michele Regano"},
607
                          {"es","3K8XL9SBSvs","Tutorial Master FTO de Mf8","Robert Cubes"},
608
                          {"ru","0CRwhZ2JNJA","Как собрать Master FTO","Алексей Ярыгин"},
609 a399e91b Leszek Koltunski
                          {"vn","4XdeuGYDCJo","Tutorial N.141 - Master FTO","Duy Thích Rubik"},
610 052e0362 Leszek Koltunski
                         };
611
      }
612
    return null;
613
    }
614 29b82486 Leszek Koltunski
}