Project

General

Profile

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

distorted-objectlib / src / main / java / org / distorted / objectlib / objects / TwistyTrajber.java @ 2dffaf22

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2020 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6
// Magic Cube is proprietary software licensed under an EULA which you should have received      //
7
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html        //
8
///////////////////////////////////////////////////////////////////////////////////////////////////
9

    
10
package org.distorted.objectlib.objects;
11

    
12
import org.distorted.library.type.Static3D;
13
import org.distorted.library.type.Static4D;
14
import org.distorted.objectlib.helpers.FactoryCubit;
15
import org.distorted.objectlib.helpers.ObjectFaceShape;
16
import org.distorted.objectlib.helpers.ObjectShape;
17
import org.distorted.objectlib.helpers.ObjectSignature;
18
import org.distorted.objectlib.helpers.ObjectVertexEffects;
19
import org.distorted.objectlib.main.ObjectSignatures;
20
import org.distorted.objectlib.scrambling.ScrambleEdgeGenerator;
21
import org.distorted.objectlib.main.InitData;
22
import org.distorted.objectlib.main.ObjectType;
23
import org.distorted.objectlib.shape.ShapeOctahedron;
24
import org.distorted.objectlib.touchcontrol.TouchControlOctahedron;
25

    
26
import java.io.InputStream;
27

    
28
import static org.distorted.objectlib.touchcontrol.TouchControl.TC_OCTAHEDRON;
29
import static org.distorted.objectlib.touchcontrol.TouchControl.TYPE_NOT_SPLIT;
30

    
31
///////////////////////////////////////////////////////////////////////////////////////////////////
32

    
33
public class TwistyTrajber extends ShapeOctahedron
34
{
35
  // Trajber 3x3: each cut is at 1/5 of the length of the segment from the center to a vertex.
36
  private static final float CUT3 = 0.20f;
37
  // Trajber 4x4: each cut is at 0.27 of the length of the segment from the center to a vertex.
38
  private static final float CUT4 = 0.27f;
39

    
40
  static final Static3D[] ROT_AXIS = new Static3D[]
41
         {
42
         new Static3D(SQ2/2, 0, SQ2/2),
43
         new Static3D(    0, 1,     0),
44
         new Static3D(SQ2/2, 0,-SQ2/2)
45
         };
46

    
47
  private int[][] mEdges;
48
  private int[][] mBasicAngle;
49
  private float[][] mCuts;
50
  private float[][] mPositions;
51
  private int[] mQuatIndex;
52

    
53
///////////////////////////////////////////////////////////////////////////////////////////////////
54

    
55
  public TwistyTrajber(InitData data, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
56
    {
57
    super(data, meshState, iconMode, data.getNumLayers()[0], quat, move, scale, stream);
58
    }
59

    
60
///////////////////////////////////////////////////////////////////////////////////////////////////
61

    
62
  @Override
63
  public int[][] getSolvedQuats()
64
    {
65
    int[] numLayers = getNumLayers();
66
    int numL = numLayers[0];
67

    
68
    if( numL==3 )
69
      {
70
      return super.getSolvedQuats();
71
      }
72
    else
73
      {
74
      // special SolvedQuats for the case where there are no corner of edge cubits.
75
      // first row {0} - means there are no corners or edges.
76
      // each next defines all cubits of a singe face
77
      // (numCubits, firstCubit, cubit1,..,cubitN-1, quat0,..., quatM)
78

    
79
      return new int[][] {
80
                           {0},
81
                           {7, 2, 6,14,26,34,41,49, 10,23},
82
                           {7,10,19,22,29,37,47,54, 10,23},
83
                           {7,11,15,23,28,33,45,52, 13,20},
84
                           {7, 3, 7,18,27,38,43,51, 13,20},
85
                           {7, 5,12,17,30,35,44,53, 12,22},
86
                           {7, 1, 8,20,25,36,42,50, 12,22},
87
                           {7, 0, 9,16,24,32,40,48, 15,21},
88
                           {7, 4,13,21,31,39,46,55, 15,21},
89
                         };
90
      }
91
    }
92

    
93
///////////////////////////////////////////////////////////////////////////////////////////////////
94

    
95
  public int[][] getScrambleEdges()
96
    {
97
    if( mEdges==null )
98
      {
99
      int n = getNumLayers()[0];
100
      mEdges = ScrambleEdgeGenerator.getScrambleEdgesCuboid(n,n,n);
101
      }
102
    return mEdges;
103
    }
104

    
105
///////////////////////////////////////////////////////////////////////////////////////////////////
106

    
107
  public float[][] getCuts(int[] numLayers)
108
    {
109
    if( mCuts==null )
110
      {
111
      float[] tmp;
112

    
113
      if( numLayers[0]==3 )
114
        {
115
        final float cut= CUT3*numLayers[0]*SQ2/2;
116
        tmp = new float[] {-cut,+cut};
117
        }
118
      else
119
        {
120
        final float cut= CUT4*numLayers[0]*SQ2/2;
121
        tmp = new float[] {-cut,0,+cut};
122
        }
123

    
124
      mCuts = new float[][] { tmp,tmp,tmp };
125
      }
126

    
127
    return mCuts;
128
    }
129

    
130
///////////////////////////////////////////////////////////////////////////////////////////////////
131

    
132
  public boolean[][] getLayerRotatable(int[] numLayers)
133
    {
134
    int numL = numLayers[0];
135
    boolean[] tmp = new boolean[numL];
136
    for(int i=0; i<numL; i++) tmp[i] = true;
137
    return new boolean[][] { tmp,tmp,tmp };
138
    }
139

    
140
///////////////////////////////////////////////////////////////////////////////////////////////////
141

    
142
  public int getTouchControlType()
143
    {
144
    return TC_OCTAHEDRON;
145
    }
146

    
147
///////////////////////////////////////////////////////////////////////////////////////////////////
148

    
149
  public int getTouchControlSplit()
150
    {
151
    return TYPE_NOT_SPLIT;
152
    }
153

    
154
///////////////////////////////////////////////////////////////////////////////////////////////////
155

    
156
  public int[][][] getEnabled()
157
    {
158
    int[][] e = {{0,1,2}};
159
    return new int[][][] {e,e,e,e,e,e,e,e};
160
    }
161

    
162
///////////////////////////////////////////////////////////////////////////////////////////////////
163

    
164
  public float[] getDist3D(int[] numLayers)
165
    {
166
    return TouchControlOctahedron.D3D;
167
    }
168

    
169
///////////////////////////////////////////////////////////////////////////////////////////////////
170

    
171
  public Static3D[] getFaceAxis()
172
    {
173
    return TouchControlOctahedron.FACE_AXIS;
174
    }
175

    
176
///////////////////////////////////////////////////////////////////////////////////////////////////
177

    
178
  public float[][] getCubitPositions(int[] numLayers)
179
    {
180
    if( mPositions==null )
181
      {
182
      int numL = numLayers[0];
183
      float LEN = numL*0.5f;
184

    
185
      if( numL==3 )
186
        {
187
        mPositions = new float[][]
188
            {
189
              {  -LEN,       0,   LEN},
190
              {   LEN,       0,  -LEN},
191
              {   LEN,       0,   LEN},
192
              {  -LEN,       0,  -LEN},
193
              {     0, SQ2*LEN,     0},
194
              {     0,-SQ2*LEN,     0},
195

    
196
              {     0,     0,   LEN},
197
              {   LEN,     0,     0},
198
              {  -LEN,     0,     0},
199
              {     0,     0,  -LEN},
200
              {-LEN/2, (SQ2/2)*LEN, LEN/2},
201
              { LEN/2, (SQ2/2)*LEN,-LEN/2},
202
              {-LEN/2,-(SQ2/2)*LEN, LEN/2},
203
              { LEN/2,-(SQ2/2)*LEN,-LEN/2},
204
              { LEN/2, (SQ2/2)*LEN, LEN/2},
205
              { LEN/2,-(SQ2/2)*LEN, LEN/2},
206
              {-LEN/2, (SQ2/2)*LEN,-LEN/2},
207
              {-LEN/2,-(SQ2/2)*LEN,-LEN/2},
208

    
209
              {       0, SQ2*LEN/3, 2*LEN/3},
210
              { 2*LEN/3, SQ2*LEN/3,       0},
211
              {       0,-SQ2*LEN/3, 2*LEN/3},
212
              { 2*LEN/3,-SQ2*LEN/3,       0},
213
              {-2*LEN/3, SQ2*LEN/3,       0},
214
              {       0, SQ2*LEN/3,-2*LEN/3},
215
              {-2*LEN/3,-SQ2*LEN/3,       0},
216
              {       0,-SQ2*LEN/3,-2*LEN/3},
217
            };
218
        }
219
      else
220
        {
221
        final float A = 0.5f*SQ2*CUT4*LEN;
222
        final float B =     CUT4*LEN;
223
        final float C = CUT4/2;
224
        final float D =-1.5f*C+0.5f;
225
        final float E = 0.5f*C+0.5f;
226
        final float F = (SQ2/2)*(1-C);
227
        final float G = C*SQ2;
228
        final float H = 1-C;
229
        final float I = LEN-0.5f*B;
230
        final float J = SQ2*(LEN-B);
231

    
232
        mPositions = new float[][]
233
            {
234
              {  -I+B,  A,  I   },
235
              {  -I+B, -A,  I   },
236
              {   I  ,  A, -I+B },
237
              {   I  , -A, -I+B },
238
              {   I-B, -A, -I   },
239
              {   I-B,  A, -I   },
240
              {   I  ,  A,  I-B },
241
              {   I  , -A,  I-B },
242
              {   I-B, -A,  I   },
243
              {   I-B,  A,  I   },
244
              {  -I  , -A, -I+B },
245
              {  -I  ,  A, -I+B },
246
              {  -I+B,  A, -I   },
247
              {  -I+B, -A, -I   },
248
              {     B,  J,  0   },
249
              {    -B,  J,  0   },
250
              {     0,  J,  B   },
251
              {     0,  J, -B   },
252
              {     B, -J,  0   },
253
              {    -B, -J,  0   },
254
              {     0, -J,  B   },
255
              {     0, -J, -B   },
256
              {  -I  , -A,  I-B },
257
              {  -I  ,  A,  I-B },
258

    
259
              {     0, G*LEN, H*LEN},
260
              {     0,-G*LEN, H*LEN},
261
              { H*LEN, G*LEN,     0},
262
              { H*LEN,-G*LEN,     0},
263
              {-H*LEN, G*LEN,     0},
264
              {-H*LEN,-G*LEN,     0},
265
              {     0, G*LEN,-H*LEN},
266
              {     0,-G*LEN,-H*LEN},
267

    
268
              {-D*LEN, F*LEN, E*LEN },
269
              {-E*LEN, F*LEN, D*LEN },
270
              { E*LEN, F*LEN,-D*LEN},
271
              { D*LEN, F*LEN,-E*LEN},
272
              {-D*LEN,-F*LEN, E*LEN },
273
              {-E*LEN,-F*LEN, D*LEN },
274
              { E*LEN,-F*LEN,-D*LEN},
275
              { D*LEN,-F*LEN,-E*LEN},
276

    
277
              { D*LEN, F*LEN, E*LEN},
278
              { E*LEN, F*LEN, D*LEN},
279
              { D*LEN,-F*LEN, E*LEN},
280
              { E*LEN,-F*LEN, D*LEN},
281
              {-D*LEN, F*LEN,-E*LEN},
282
              {-E*LEN, F*LEN,-D*LEN},
283
              {-D*LEN,-F*LEN,-E*LEN},
284
              {-E*LEN,-F*LEN,-D*LEN},
285

    
286
              {       0, SQ2*LEN/3, 2*LEN/3},
287
              { 2*LEN/3, SQ2*LEN/3,       0},
288
              {       0,-SQ2*LEN/3, 2*LEN/3},
289
              { 2*LEN/3,-SQ2*LEN/3,       0},
290
              {-2*LEN/3, SQ2*LEN/3,       0},
291
              {       0, SQ2*LEN/3,-2*LEN/3},
292
              {-2*LEN/3,-SQ2*LEN/3,       0},
293
              {       0,-SQ2*LEN/3,-2*LEN/3},
294
            };
295
        }
296
      }
297

    
298
    return mPositions;
299
    }
300

    
301
///////////////////////////////////////////////////////////////////////////////////////////////////
302

    
303
  public Static4D getCubitQuats(int cubit, int[] numLayers)
304
    {
305
    if( mQuatIndex==null )
306
      {
307
      if( numLayers[0]==3 )
308
        {
309
        mQuatIndex = new int[] { 0, 2, 6, 4, 1, 3,
310
                                 0, 2, 8, 5, 7,19, 9,18, 1, 3,14,11,
311
                                 0, 1, 3, 2, 7, 5, 8,16 };
312
        }
313
      else
314
        {
315
        mQuatIndex = new int[] { 0, 9,19, 2,18, 5, 6,12,17,21,20, 4,10,16, 1,14,15,13,23,22, 3,11, 8, 7,
316
                                 0,17, 6, 2, 4, 8, 5,16,15, 7,19,13, 9,22,23,18,21, 1, 3,12,10,14,11,20,
317
                                 0, 1, 3, 2, 7, 5, 8,16 };
318
        }
319
      }
320

    
321
    return mObjectQuats[mQuatIndex[cubit]];
322
    }
323

    
324
///////////////////////////////////////////////////////////////////////////////////////////////////
325

    
326
  private float[][] getVertices(int variant)
327
    {
328
    float numL = getNumLayers()[0];
329
    final float LEN = numL*0.5f;
330
    final float CUT = numL==3 ? CUT3 : CUT4;
331

    
332
    if( variant==0 )
333
      {
334
      final float A = SQ2*CUT*LEN;
335
      final float B =     CUT*LEN;
336

    
337
      if( numL==3 )
338
        {
339
        return new float[][]
340
          {
341
             {    0,    0,    0},
342
             {    B,    A,   -B},
343
             {    B,   -A,   -B},
344
             {  2*B,    0,    0},
345
             {    0,    0, -2*B},
346
             {  3*B,    A,   -B},
347
             {  3*B,   -A,   -B},
348
             {    B,    A, -3*B},
349
             {    B,   -A, -3*B},
350

    
351
             {  LEN    ,  A, 2*B-LEN},
352
             {  LEN    , -A, 2*B-LEN},
353
             {  LEN-2*B,  A,    -LEN},
354
             {  LEN-2*B, -A,    -LEN},
355
          };
356
        }
357
      else
358
        {
359
        return new float[][]
360
          {
361
             {  -1.5f*B,  -0.5f*A,  0.5f*B},
362
             {  -0.5f*B,   0.5f*A, -0.5f*B},
363
             {   0.5f*B,  -0.5f*A,  0.5f*B},
364
             {   1.5f*B,   0.5f*A, -0.5f*B},
365

    
366
             {  LEN-1.5f*B,  0.5f*A, 2.5f*B-LEN},
367
             {  LEN-2.5f*B,  0.5f*A, 1.5f*B-LEN},
368
             {  LEN-2.5f*B, -0.5f*A, 1.5f*B-LEN},
369
             {  LEN-1.5f*B, -0.5f*A, 2.5f*B-LEN},
370
          };
371
        }
372
      }
373
    else if( variant==1 )
374
      {
375
      final float A = SQ2*CUT*LEN;
376
      final float B = LEN*(1-2*CUT);
377
      final float C = (SQ2/2)*A;
378

    
379
      if( numL==3 )
380
        {
381
        return new float[][]
382
          {
383
             {    -B, 0,  0 },
384
             {  -B+C, A, -C },
385
             {  -B+C,-A, -C },
386
             {     B, 0,  0 },
387
             {   B-C, A, -C },
388
             {   B-C,-A, -C },
389
             {     0, A, -B },
390
             {     0,-A, -B },
391
          };
392
        }
393
      else
394
        {
395
        return new float[][]
396
          {
397
             {    -B, -0.5f*A,    C/2 },
398
             {  -B+C,  0.5f*A,   -C/2 },
399
             {     B, -0.5f*A,    C/2 },
400
             {   B-C,  0.5f*A,   -C/2 },
401
             {     0,  0.5f*A, -B+C/2 },
402
             {     0, -0.5f*A, -B+C/2 }
403
          };
404
        }
405
      }
406
    else
407
      {
408
      final float L = LEN*(1-3*CUT);
409

    
410
      return new float[][]
411
          {
412
             { -L, -(SQ2/3)*L,   L/3 },
413
             {  L, -(SQ2/3)*L,   L/3 },
414
             {  0,(2*SQ2/3)*L,-2*L/3 },
415
             {  0, -(SQ2/3)*L,-2*L/3 },
416
          };
417
      }
418
    }
419

    
420
///////////////////////////////////////////////////////////////////////////////////////////////////
421

    
422
  public ObjectShape getObjectShape(int variant)
423
    {
424
    float numL = getNumLayers()[0];
425

    
426
    if( variant==0 )
427
      {
428
      int[][] indices = numL==3 ?
429

    
430
        new int[][]
431
          {
432
             {0,3,5,1},
433
             {0,2,6,3},
434
             {0,4,8,2},
435
             {0,1,7,4},
436
             {3,6,10,9,5},
437
             {2,8,12,10,6},
438
             {4,7,11,12,8},
439
             {1,5,9,11,7},
440
             {9,10,12,11}
441
          }
442
        :
443
        new int[][]
444
          {
445
             {0,2,3,1},
446
             {2,7,4,3},
447
             {3,4,5,1},
448
             {0,1,5,6},
449
             {0,6,7,2},
450
             {7,6,5,4}
451
          };
452

    
453
      return new ObjectShape(getVertices(variant), indices);
454
      }
455
    if( variant==1 )
456
      {
457
      int[][] indices = numL==3 ?
458

    
459
        new int[][]
460
          {
461
             {0,3,4,1},
462
             {0,2,5,3},
463
             {1,4,6},
464
             {2,7,5},
465
             {0,1,6,7,2},
466
             {3,5,7,6,4}
467
          }
468
        :
469
        new int[][]
470
          {
471
             {0,2,3,1},
472
             {1,3,4},
473
             {0,5,2},
474
             {0,1,4,5},
475
             {2,5,4,3}
476
          };
477

    
478
      return new ObjectShape(getVertices(variant), indices);
479
      }
480
    else
481
      {
482
      int[][] indices =
483
          {
484
             {0,1,2},
485
             {3,1,0},
486
             {0,2,3},
487
             {1,3,2},
488
          };
489

    
490
      return new ObjectShape(getVertices(variant), indices);
491
      }
492
    }
493

    
494
///////////////////////////////////////////////////////////////////////////////////////////////////
495

    
496
  public ObjectFaceShape getObjectFaceShape(int variant)
497
    {
498
    int numL = getNumLayers()[0];
499

    
500
    if( variant==0 )
501
      {
502
      float height = isInIconMode() ? 0.001f : 0.05f;
503
      float[][] bands = { {height,35,0.15f,0.3f,4,1,1},{0.001f,35,0.15f,0.3f,4,1,1} };
504
      int[] indices   = numL==3 ? new int[] { 0,0,0,0,1,1,1,1,1 } : new int[] { 0,1,1,1,1,1 };
505
      return new ObjectFaceShape(bands,indices,null);
506
      }
507
    if( variant==1 )
508
      {
509
      float height = isInIconMode() ? 0.001f : 0.03f;
510
      float[][] bands = { {height,35,0.15f,0.3f,3,1,1},{0.001f,35,0.15f,0.3f,3,1,1} };
511
      int[] indices   = numL==3 ? new int[] { 0,0,1,1,1,1 }       : new int[] { 0,1,1,1,1 };
512
      return new ObjectFaceShape(bands,indices,null);
513
      }
514
    else
515
      {
516
      float height = isInIconMode() ? 0.001f : 0.03f;
517
      float[][] bands = { {height,35,0.15f,0.3f,4,1,1},{0.001f,35,0.15f,0.3f,4,0,0} };
518
      int[] indices   = { 0,1,1,1 };
519
      return new ObjectFaceShape(bands,indices,null);
520
      }
521
    }
522

    
523
///////////////////////////////////////////////////////////////////////////////////////////////////
524

    
525
  public ObjectVertexEffects getVertexEffects(int variant)
526
    {
527
    int numL = getNumLayers()[0];
528
    final float LEN = numL*0.5f;
529
    final float CUT = numL==3 ? CUT3 : CUT4;
530

    
531
    if( variant==0 )
532
      {
533
      float[][] vertices= getVertices(variant);
534
      float[][] corners = { {0.03f,0.10f} };
535
      float[][] centers = { { LEN/2, 0.0f, -LEN/2} };
536
      int[] indices     = numL==3 ? new int[] { 0,-1,-1,-1,-1,0,0,0,0,-1,-1,-1,-1 } : new int[] { 0,0,0,-1,-1,-1,-1,-1 };
537
      return FactoryCubit.generateVertexEffect(vertices,corners,indices,centers,indices);
538
      }
539
    if( variant==1 )
540
      {
541
      float[][] vertices= getVertices(variant);
542
      final float B = LEN*(1-2*CUT);
543
      float[][] corners = { {0.02f,0.10f} };
544
      float[][] centers = { { 0, 0, -B} };
545
      int[] indices     = numL==3 ? new int[] { 0,0,0,0,0,0,-1,-1 } : new int[] { 0,0,0,0,-1,-1 };
546
      return FactoryCubit.generateVertexEffect(vertices,corners,indices,centers,indices);
547
      }
548
    else
549
      {
550
      float[][] vertices= getVertices(variant);
551
      final float L = LEN*(1-3*CUT);
552
      float[][] corners = { {0.02f,0.10f} };
553
      float[][] centers = { {0, -(SQ2/3)*L,-2*L/3} };
554
      int[] indices     = { 0,0,0,-1 };
555
      return FactoryCubit.generateVertexEffect(vertices,corners,indices,centers,indices);
556
      }
557
    }
558

    
559
///////////////////////////////////////////////////////////////////////////////////////////////////
560

    
561
  public int getNumCubitVariants(int[] numLayers)
562
    {
563
    return 3;
564
    }
565

    
566
///////////////////////////////////////////////////////////////////////////////////////////////////
567

    
568
  public int getCubitVariant(int cubit, int[] numLayers)
569
    {
570
    if( numLayers[0]==3 ) return cubit< 6 ? 0 : cubit<18 ? 1 : 2;
571
    else                  return cubit<24 ? 0 : cubit<48 ? 1 : 2;
572
    }
573

    
574
///////////////////////////////////////////////////////////////////////////////////////////////////
575

    
576
  public float getStickerRadius()
577
    {
578
    return 0.12f;
579
    }
580

    
581
///////////////////////////////////////////////////////////////////////////////////////////////////
582

    
583
  public float getStickerStroke()
584
    {
585
    return isInIconMode() ? 0.20f : 0.10f;
586
    }
587

    
588
///////////////////////////////////////////////////////////////////////////////////////////////////
589

    
590
  public float[][] getStickerAngles()
591
    {
592
    return null;
593
    }
594

    
595
///////////////////////////////////////////////////////////////////////////////////////////////////
596
// PUBLIC API
597

    
598
  public Static3D[] getRotationAxis()
599
    {
600
    return ROT_AXIS;
601
    }
602

    
603
///////////////////////////////////////////////////////////////////////////////////////////////////
604

    
605
  public int[][] getBasicAngles()
606
    {
607
    if( mBasicAngle ==null )
608
      {
609
      int num = getNumLayers()[0];
610
      int[] tmp = new int[num];
611
      for(int i=0; i<num; i++) tmp[i] = 4;
612
      mBasicAngle = new int[][] { tmp,tmp,tmp };
613
      }
614

    
615
    return mBasicAngle;
616
    }
617

    
618
///////////////////////////////////////////////////////////////////////////////////////////////////
619

    
620
  public String getShortName()
621
    {
622
    int[] numLayers = getNumLayers();
623
    return numLayers[0]==3 ? ObjectType.TRAJ_3.name() : ObjectType.TRAJ_4.name();
624
    }
625

    
626
///////////////////////////////////////////////////////////////////////////////////////////////////
627

    
628
  public ObjectSignature getSignature()
629
    {
630
    int[] numLayers = getNumLayers();
631

    
632
    switch(numLayers[0])
633
      {
634
      case 3: return new ObjectSignature(ObjectSignatures.TRAJ_3);
635
      case 4: return new ObjectSignature(ObjectSignatures.TRAJ_4);
636
      }
637

    
638
    return null;
639
    }
640

    
641
///////////////////////////////////////////////////////////////////////////////////////////////////
642

    
643
  public String getObjectName()
644
    {
645
    int[] numLayers = getNumLayers();
646

    
647
    switch(numLayers[0])
648
      {
649
      case 3: return "Trajber's Octahedron";
650
      case 4: return "Trajber 4x4";
651
      }
652

    
653
    return null;
654
    }
655

    
656
///////////////////////////////////////////////////////////////////////////////////////////////////
657

    
658
  public String getInventor()
659
    {
660
    int[] numLayers = getNumLayers();
661

    
662
    switch(numLayers[0])
663
      {
664
      case 3: return "Josef Trajber";
665
      case 4: return "Jürgen Brandt";
666
      }
667

    
668
    return null;
669
    }
670

    
671
///////////////////////////////////////////////////////////////////////////////////////////////////
672

    
673
  public int getYearOfInvention()
674
    {
675
    int[] numLayers = getNumLayers();
676
    return numLayers[0]==3 ? 1982 : 2001;
677
    }
678

    
679
///////////////////////////////////////////////////////////////////////////////////////////////////
680

    
681
  public int getComplexity()
682
    {
683
    int[] numLayers = getNumLayers();
684
    return numLayers[0]==3 ? 2 : 3;
685
    }
686

    
687
///////////////////////////////////////////////////////////////////////////////////////////////////
688

    
689
  public String[][] getTutorials()
690
    {
691
    int[] numLayers = getNumLayers();
692

    
693
    switch(numLayers[0])
694
      {
695
      case 3: return new String[][] {
696
                                     {"gb","Q2NSiuJWVvk","Trajber and UFO Tutorial","SuperAntoniovivaldi"},
697
                                     {"es","FPBirEJ8ZfY","Resolver Octaedro 3x3","Solución Rubik"},
698
                                     {"de","FjQXlwJGniQ","Trajbers Octahedron Tutorial","GerCubing"},
699
                                     {"br","kO3nMpZKv3Q","Resolver Octaedro Trajber","Rafael Cinoto"},
700
                                    };
701
      case 4: return new String[][] {
702
                                     {"gb","FZlw68I7snM","4x4 Trajber's Tutorial (1/2)","SuperAntoniovivaldi"},
703
                                     {"gb","VM0XFu7gAII","4x4 Trajber's Tutorial (2/2)","SuperAntoniovivaldi"},
704
                                     {"es","Q8ljV-feLpU","Tutorial Octaedro 4x4 (1/2)","Dany Cuber"},
705
                                     {"es","QyWpDLa1eZQ","Tutorial Octaedro 4x4 (2/2)","Dany Cuber"},
706
                                     {"ru","ikUogVow-58","Как собрать Октаэдр 4х4","RBcuber"},
707
                                     {"fr","4hxZyMVGiTA","Résolution de l'Octaèdre 4x4","asthalis"},
708
                                     {"pl","oPBvAT9lwt4","Octahedron 4x4 TUTORIAL PL","MrUK"},
709
                                     {"br","0ZgaoQ6IS2w","Resolver o octaedro Trajber 4x4 (1/3)","Rafael Cinoto"},
710
                                     {"br","TjxTx3IJy6M","Resolver o octaedro Trajber 4x4 (2/3)","Rafael Cinoto"},
711
                                     {"br","E8k2TXfUS8g","Resolver o octaedro Trajber 4x4 (3/3)","Rafael Cinoto"},
712
                                     {"vn","yorULpIm6Yw","Tutorial N.22 - Octahedron 4x4","Duy Thích Rubik"},
713
                                    };
714
      }
715

    
716
    return null;
717
    }
718
}
(38-38/41)