Project

General

Profile

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

distorted-objectlib / src / main / java / org / distorted / objectlib / objects / TwistyTrajber.java @ 361fd0de

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.metadata.Metadata;
18
import org.distorted.objectlib.signature.ObjectSignature;
19
import org.distorted.objectlib.helpers.ObjectVertexEffects;
20
import org.distorted.objectlib.main.InitAssets;
21
import org.distorted.objectlib.signature.ObjectConstants;
22
import org.distorted.objectlib.scrambling.ScrambleEdgeGenerator;
23
import org.distorted.objectlib.metadata.ListObjects;
24
import org.distorted.objectlib.shape.ShapeOctahedron;
25
import org.distorted.objectlib.touchcontrol.TouchControlOctahedron;
26

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

    
30
///////////////////////////////////////////////////////////////////////////////////////////////////
31

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

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

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

    
52
///////////////////////////////////////////////////////////////////////////////////////////////////
53

    
54
  public TwistyTrajber(int iconMode, Static4D quat, Static3D move, float scale, Metadata meta, InitAssets asset)
55
    {
56
    super(iconMode, meta.getNumLayers()[0], quat, move, scale, meta, asset);
57
    }
58

    
59
///////////////////////////////////////////////////////////////////////////////////////////////////
60

    
61
  @Override
62
  public float[][] returnRotationFactor()
63
    {
64
    int numL = getNumLayers()[0];
65
    float[] f = new float[numL];
66
    for(int i=0; i<numL; i++) f[i] = 1.4f;
67
    return new float[][] { f,f,f };
68
    }
69

    
70
///////////////////////////////////////////////////////////////////////////////////////////////////
71

    
72
  @Override
73
  public int[][] getSolvedQuats()
74
    {
75
    int[] numLayers = getNumLayers();
76
    int numL = numLayers[0];
77

    
78
    if( numL==3 )
79
      {
80
      return super.getSolvedQuats();
81
      }
82
    else
83
      {
84
      // special SolvedQuats for the case where there are no corner of edge cubits.
85
      // first row {0} - means there are no corners or edges.
86
      // each next defines all cubits of a singe face
87
      // (numCubits, firstCubit, cubit1,..,cubitN-1, quat0,..., quatM)
88

    
89
      return new int[][] {
90
                           {0},
91
                           {7, 2, 6,14,26,34,41,49, 10,23},
92
                           {7,10,19,22,29,37,47,54, 10,23},
93
                           {7,11,15,23,28,33,45,52, 13,20},
94
                           {7, 3, 7,18,27,38,43,51, 13,20},
95
                           {7, 5,12,17,30,35,44,53, 12,22},
96
                           {7, 1, 8,20,25,36,42,50, 12,22},
97
                           {7, 0, 9,16,24,32,40,48, 15,21},
98
                           {7, 4,13,21,31,39,46,55, 15,21},
99
                         };
100
      }
101
    }
102

    
103
///////////////////////////////////////////////////////////////////////////////////////////////////
104

    
105
  public int[][] getScrambleEdges()
106
    {
107
    if( mEdges==null )
108
      {
109
      int n = getNumLayers()[0];
110
      mEdges = ScrambleEdgeGenerator.getScrambleEdgesCuboid(n,n,n);
111
      }
112
    return mEdges;
113
    }
114

    
115
///////////////////////////////////////////////////////////////////////////////////////////////////
116

    
117
  public float[][] getCuts(int[] numLayers)
118
    {
119
    if( mCuts==null )
120
      {
121
      float[] tmp;
122

    
123
      if( numLayers[0]==3 )
124
        {
125
        final float cut= CUT3*numLayers[0]*SQ2/2;
126
        tmp = new float[] {-cut,+cut};
127
        }
128
      else
129
        {
130
        final float cut= CUT4*numLayers[0]*SQ2/2;
131
        tmp = new float[] {-cut,0,+cut};
132
        }
133

    
134
      mCuts = new float[][] { tmp,tmp,tmp };
135
      }
136

    
137
    return mCuts;
138
    }
139

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

    
142
  public boolean[][] getLayerRotatable(int[] numLayers)
143
    {
144
    int numL = numLayers[0];
145
    boolean[] tmp = new boolean[numL];
146
    for(int i=0; i<numL; i++) tmp[i] = true;
147
    return new boolean[][] { tmp,tmp,tmp };
148
    }
149

    
150
///////////////////////////////////////////////////////////////////////////////////////////////////
151

    
152
  public int getTouchControlType()
153
    {
154
    return TC_OCTAHEDRON;
155
    }
156

    
157
///////////////////////////////////////////////////////////////////////////////////////////////////
158

    
159
  public int getTouchControlSplit()
160
    {
161
    return TYPE_NOT_SPLIT;
162
    }
163

    
164
///////////////////////////////////////////////////////////////////////////////////////////////////
165

    
166
  public int[][][] getEnabled()
167
    {
168
    int[][] e = {{0,1,2}};
169
    return new int[][][] {e,e,e,e,e,e,e,e};
170
    }
171

    
172
///////////////////////////////////////////////////////////////////////////////////////////////////
173

    
174
  public float[] getDist3D(int[] numLayers)
175
    {
176
    return TouchControlOctahedron.D3D;
177
    }
178

    
179
///////////////////////////////////////////////////////////////////////////////////////////////////
180

    
181
  public Static3D[] getFaceAxis()
182
    {
183
    return TouchControlOctahedron.FACE_AXIS;
184
    }
185

    
186
///////////////////////////////////////////////////////////////////////////////////////////////////
187

    
188
  public float[][] getCubitPositions(int[] numLayers)
189
    {
190
    if( mPositions==null )
191
      {
192
      int numL = numLayers[0];
193
      float LEN = numL*0.5f;
194

    
195
      if( numL==3 )
196
        {
197
        mPositions = new float[][]
198
            {
199
              {  -LEN,       0,   LEN},
200
              {   LEN,       0,  -LEN},
201
              {   LEN,       0,   LEN},
202
              {  -LEN,       0,  -LEN},
203
              {     0, SQ2*LEN,     0},
204
              {     0,-SQ2*LEN,     0},
205

    
206
              {     0,     0,   LEN},
207
              {   LEN,     0,     0},
208
              {  -LEN,     0,     0},
209
              {     0,     0,  -LEN},
210
              {-LEN/2, (SQ2/2)*LEN, LEN/2},
211
              { LEN/2, (SQ2/2)*LEN,-LEN/2},
212
              {-LEN/2,-(SQ2/2)*LEN, LEN/2},
213
              { LEN/2,-(SQ2/2)*LEN,-LEN/2},
214
              { LEN/2, (SQ2/2)*LEN, LEN/2},
215
              { LEN/2,-(SQ2/2)*LEN, LEN/2},
216
              {-LEN/2, (SQ2/2)*LEN,-LEN/2},
217
              {-LEN/2,-(SQ2/2)*LEN,-LEN/2},
218

    
219
              {       0, SQ2*LEN/3, 2*LEN/3},
220
              { 2*LEN/3, SQ2*LEN/3,       0},
221
              {       0,-SQ2*LEN/3, 2*LEN/3},
222
              { 2*LEN/3,-SQ2*LEN/3,       0},
223
              {-2*LEN/3, SQ2*LEN/3,       0},
224
              {       0, SQ2*LEN/3,-2*LEN/3},
225
              {-2*LEN/3,-SQ2*LEN/3,       0},
226
              {       0,-SQ2*LEN/3,-2*LEN/3},
227
            };
228
        }
229
      else
230
        {
231
        final float A = 0.5f*SQ2*CUT4*LEN;
232
        final float B =     CUT4*LEN;
233
        final float C = CUT4/2;
234
        final float D =-1.5f*C+0.5f;
235
        final float E = 0.5f*C+0.5f;
236
        final float F = (SQ2/2)*(1-C);
237
        final float G = C*SQ2;
238
        final float H = 1-C;
239
        final float I = LEN-0.5f*B;
240
        final float J = SQ2*(LEN-B);
241

    
242
        mPositions = new float[][]
243
            {
244
              {  -I+B,  A,  I   },
245
              {  -I+B, -A,  I   },
246
              {   I  ,  A, -I+B },
247
              {   I  , -A, -I+B },
248
              {   I-B, -A, -I   },
249
              {   I-B,  A, -I   },
250
              {   I  ,  A,  I-B },
251
              {   I  , -A,  I-B },
252
              {   I-B, -A,  I   },
253
              {   I-B,  A,  I   },
254
              {  -I  , -A, -I+B },
255
              {  -I  ,  A, -I+B },
256
              {  -I+B,  A, -I   },
257
              {  -I+B, -A, -I   },
258
              {     B,  J,  0   },
259
              {    -B,  J,  0   },
260
              {     0,  J,  B   },
261
              {     0,  J, -B   },
262
              {     B, -J,  0   },
263
              {    -B, -J,  0   },
264
              {     0, -J,  B   },
265
              {     0, -J, -B   },
266
              {  -I  , -A,  I-B },
267
              {  -I  ,  A,  I-B },
268

    
269
              {     0, G*LEN, H*LEN},
270
              {     0,-G*LEN, H*LEN},
271
              { H*LEN, G*LEN,     0},
272
              { H*LEN,-G*LEN,     0},
273
              {-H*LEN, G*LEN,     0},
274
              {-H*LEN,-G*LEN,     0},
275
              {     0, G*LEN,-H*LEN},
276
              {     0,-G*LEN,-H*LEN},
277

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

    
287
              { D*LEN, F*LEN, E*LEN},
288
              { E*LEN, F*LEN, D*LEN},
289
              { D*LEN,-F*LEN, E*LEN},
290
              { E*LEN,-F*LEN, D*LEN},
291
              {-D*LEN, F*LEN,-E*LEN},
292
              {-E*LEN, F*LEN,-D*LEN},
293
              {-D*LEN,-F*LEN,-E*LEN},
294
              {-E*LEN,-F*LEN,-D*LEN},
295

    
296
              {       0, SQ2*LEN/3, 2*LEN/3},
297
              { 2*LEN/3, SQ2*LEN/3,       0},
298
              {       0,-SQ2*LEN/3, 2*LEN/3},
299
              { 2*LEN/3,-SQ2*LEN/3,       0},
300
              {-2*LEN/3, SQ2*LEN/3,       0},
301
              {       0, SQ2*LEN/3,-2*LEN/3},
302
              {-2*LEN/3,-SQ2*LEN/3,       0},
303
              {       0,-SQ2*LEN/3,-2*LEN/3},
304
            };
305
        }
306
      }
307

    
308
    return mPositions;
309
    }
310

    
311
///////////////////////////////////////////////////////////////////////////////////////////////////
312

    
313
  public Static4D getCubitQuats(int cubit, int[] numLayers)
314
    {
315
    if( mQuatIndex==null )
316
      {
317
      if( numLayers[0]==3 )
318
        {
319
        mQuatIndex = new int[] { 0, 2, 6, 4, 1, 3,
320
                                 0, 2, 8, 5, 7,19, 9,18, 1, 3,14,11,
321
                                 0, 1, 3, 2, 7, 5, 8,16 };
322
        }
323
      else
324
        {
325
        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,
326
                                 0,17, 6, 2, 4, 8, 5,16,15, 7,19,13, 9,22,23,18,21, 1, 3,12,10,14,11,20,
327
                                 0, 1, 3, 2, 7, 5, 8,16 };
328
        }
329
      }
330

    
331
    return mObjectQuats[mQuatIndex[cubit]];
332
    }
333

    
334
///////////////////////////////////////////////////////////////////////////////////////////////////
335

    
336
  private float[][] getVertices(int variant)
337
    {
338
    float numL = getNumLayers()[0];
339
    final float LEN = numL*0.5f;
340
    final float CUT = numL==3 ? CUT3 : CUT4;
341

    
342
    if( variant==0 )
343
      {
344
      final float A = SQ2*CUT*LEN;
345
      final float B =     CUT*LEN;
346

    
347
      if( numL==3 )
348
        {
349
        return new float[][]
350
          {
351
             {    0,    0,    0},
352
             {    B,    A,   -B},
353
             {    B,   -A,   -B},
354
             {  2*B,    0,    0},
355
             {    0,    0, -2*B},
356
             {  3*B,    A,   -B},
357
             {  3*B,   -A,   -B},
358
             {    B,    A, -3*B},
359
             {    B,   -A, -3*B},
360

    
361
             {  LEN    ,  A, 2*B-LEN},
362
             {  LEN    , -A, 2*B-LEN},
363
             {  LEN-2*B,  A,    -LEN},
364
             {  LEN-2*B, -A,    -LEN},
365
          };
366
        }
367
      else
368
        {
369
        return new float[][]
370
          {
371
             {  -1.5f*B,  -0.5f*A,  0.5f*B},
372
             {  -0.5f*B,   0.5f*A, -0.5f*B},
373
             {   0.5f*B,  -0.5f*A,  0.5f*B},
374
             {   1.5f*B,   0.5f*A, -0.5f*B},
375

    
376
             {  LEN-1.5f*B,  0.5f*A, 2.5f*B-LEN},
377
             {  LEN-2.5f*B,  0.5f*A, 1.5f*B-LEN},
378
             {  LEN-2.5f*B, -0.5f*A, 1.5f*B-LEN},
379
             {  LEN-1.5f*B, -0.5f*A, 2.5f*B-LEN},
380
          };
381
        }
382
      }
383
    else if( variant==1 )
384
      {
385
      final float A = SQ2*CUT*LEN;
386
      final float B = LEN*(1-2*CUT);
387
      final float C = (SQ2/2)*A;
388

    
389
      if( numL==3 )
390
        {
391
        return new float[][]
392
          {
393
             {    -B, 0,  0 },
394
             {  -B+C, A, -C },
395
             {  -B+C,-A, -C },
396
             {     B, 0,  0 },
397
             {   B-C, A, -C },
398
             {   B-C,-A, -C },
399
             {     0, A, -B },
400
             {     0,-A, -B },
401
          };
402
        }
403
      else
404
        {
405
        return new float[][]
406
          {
407
             {    -B, -0.5f*A,    C/2 },
408
             {  -B+C,  0.5f*A,   -C/2 },
409
             {     B, -0.5f*A,    C/2 },
410
             {   B-C,  0.5f*A,   -C/2 },
411
             {     0,  0.5f*A, -B+C/2 },
412
             {     0, -0.5f*A, -B+C/2 }
413
          };
414
        }
415
      }
416
    else
417
      {
418
      final float L = LEN*(1-3*CUT);
419

    
420
      return new float[][]
421
          {
422
             { -L, -(SQ2/3)*L,   L/3 },
423
             {  L, -(SQ2/3)*L,   L/3 },
424
             {  0,(2*SQ2/3)*L,-2*L/3 },
425
             {  0, -(SQ2/3)*L,-2*L/3 },
426
          };
427
      }
428
    }
429

    
430
///////////////////////////////////////////////////////////////////////////////////////////////////
431

    
432
  public ObjectShape getObjectShape(int variant)
433
    {
434
    float numL = getNumLayers()[0];
435

    
436
    if( variant==0 )
437
      {
438
      int[][] indices = numL==3 ?
439

    
440
        new int[][]
441
          {
442
             {0,3,5,1},
443
             {0,2,6,3},
444
             {0,4,8,2},
445
             {0,1,7,4},
446
             {3,6,10,9,5},
447
             {2,8,12,10,6},
448
             {4,7,11,12,8},
449
             {1,5,9,11,7},
450
             {9,10,12,11}
451
          }
452
        :
453
        new int[][]
454
          {
455
             {0,2,3,1},
456
             {2,7,4,3},
457
             {3,4,5,1},
458
             {0,1,5,6},
459
             {0,6,7,2},
460
             {7,6,5,4}
461
          };
462

    
463
      return new ObjectShape(getVertices(variant), indices);
464
      }
465
    if( variant==1 )
466
      {
467
      int[][] indices = numL==3 ?
468

    
469
        new int[][]
470
          {
471
             {0,3,4,1},
472
             {0,2,5,3},
473
             {1,4,6},
474
             {2,7,5},
475
             {0,1,6,7,2},
476
             {3,5,7,6,4}
477
          }
478
        :
479
        new int[][]
480
          {
481
             {0,2,3,1},
482
             {1,3,4},
483
             {0,5,2},
484
             {0,1,4,5},
485
             {2,5,4,3}
486
          };
487

    
488
      return new ObjectShape(getVertices(variant), indices);
489
      }
490
    else
491
      {
492
      int[][] indices =
493
          {
494
             {0,1,2},
495
             {3,1,0},
496
             {0,2,3},
497
             {1,3,2},
498
          };
499

    
500
      return new ObjectShape(getVertices(variant), indices);
501
      }
502
    }
503

    
504
///////////////////////////////////////////////////////////////////////////////////////////////////
505

    
506
  public ObjectFaceShape getObjectFaceShape(int variant)
507
    {
508
    int numL = getNumLayers()[0];
509
    int angle = 30;
510
    float R = 0.9f;
511
    float S = 0.2f;
512

    
513
    if( variant==0 )
514
      {
515
      float height = isInIconMode() ? 0.001f : 0.05f;
516
      float[][] bands = { {height,angle,R,S,4,1,1},{0.001f,angle,R,S,4,1,1} };
517
      int[] indices   = numL==3 ? new int[] { 0,0,0,0,1,1,1,1,1 } : new int[] { 0,1,1,1,1,1 };
518
      return new ObjectFaceShape(bands,indices,null);
519
      }
520
    if( variant==1 )
521
      {
522
      float height = isInIconMode() ? 0.001f : 0.03f;
523
      float[][] bands = { {height,angle,R,S,3,1,1},{0.001f,angle,R,S,3,1,1} };
524
      int[] indices   = numL==3 ? new int[] { 0,0,1,1,1,1 }       : new int[] { 0,1,1,1,1 };
525
      return new ObjectFaceShape(bands,indices,null);
526
      }
527
    else
528
      {
529
      float height = isInIconMode() ? 0.001f : 0.03f;
530
      float[][] bands = { {height,angle,R,S,4,1,1},{0.001f,angle,R,S,4,0,0} };
531
      int[] indices   = { 0,1,1,1 };
532
      return new ObjectFaceShape(bands,indices,null);
533
      }
534
    }
535

    
536
///////////////////////////////////////////////////////////////////////////////////////////////////
537

    
538
  public ObjectVertexEffects getVertexEffects(int variant)
539
    {
540
    int numL = getNumLayers()[0];
541
    final float LEN = numL*0.5f;
542
    final float CUT = numL==3 ? CUT3 : CUT4;
543

    
544
    if( variant==0 )
545
      {
546
      float[][] vertices= getVertices(variant);
547
      float[][] corners = { {0.03f,0.10f} };
548
      float[][] centers = { { LEN/2, 0.0f, -LEN/2} };
549
      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 };
550
      return FactoryCubit.generateVertexEffect(vertices,corners,indices,centers,indices);
551
      }
552
    if( variant==1 )
553
      {
554
      float[][] vertices= getVertices(variant);
555
      final float B = LEN*(1-2*CUT);
556
      float[][] corners = { {0.02f,0.10f} };
557
      float[][] centers = { { 0, 0, -B} };
558
      int[] indices     = numL==3 ? new int[] { 0,0,0,0,0,0,-1,-1 } : new int[] { 0,0,0,0,-1,-1 };
559
      return FactoryCubit.generateVertexEffect(vertices,corners,indices,centers,indices);
560
      }
561
    else
562
      {
563
      float[][] vertices= getVertices(variant);
564
      final float L = LEN*(1-3*CUT);
565
      float[][] corners = { {0.02f,0.10f} };
566
      float[][] centers = { {0, -(SQ2/3)*L,-2*L/3} };
567
      int[] indices     = { 0,0,0,-1 };
568
      return FactoryCubit.generateVertexEffect(vertices,corners,indices,centers,indices);
569
      }
570
    }
571

    
572
///////////////////////////////////////////////////////////////////////////////////////////////////
573

    
574
  public int getNumCubitVariants(int[] numLayers)
575
    {
576
    return 3;
577
    }
578

    
579
///////////////////////////////////////////////////////////////////////////////////////////////////
580

    
581
  public int getCubitVariant(int cubit, int[] numLayers)
582
    {
583
    if( numLayers[0]==3 ) return cubit< 6 ? 0 : cubit<18 ? 1 : 2;
584
    else                  return cubit<24 ? 0 : cubit<48 ? 1 : 2;
585
    }
586

    
587
///////////////////////////////////////////////////////////////////////////////////////////////////
588

    
589
  public float getStickerRadius()
590
    {
591
    return 0.12f;
592
    }
593

    
594
///////////////////////////////////////////////////////////////////////////////////////////////////
595

    
596
  public float getStickerStroke()
597
    {
598
    return isInIconMode() ? 0.20f : 0.10f;
599
    }
600

    
601
///////////////////////////////////////////////////////////////////////////////////////////////////
602

    
603
  public float[][][] getStickerAngles()
604
    {
605
    return null;
606
    }
607

    
608
///////////////////////////////////////////////////////////////////////////////////////////////////
609
// PUBLIC API
610

    
611
  public Static3D[] getRotationAxis()
612
    {
613
    return ROT_AXIS;
614
    }
615

    
616
///////////////////////////////////////////////////////////////////////////////////////////////////
617

    
618
  public int[][] getBasicAngles()
619
    {
620
    if( mBasicAngle ==null )
621
      {
622
      int num = getNumLayers()[0];
623
      int[] tmp = new int[num];
624
      for(int i=0; i<num; i++) tmp[i] = 4;
625
      mBasicAngle = new int[][] { tmp,tmp,tmp };
626
      }
627

    
628
    return mBasicAngle;
629
    }
630

    
631
///////////////////////////////////////////////////////////////////////////////////////////////////
632

    
633
  public String getShortName()
634
    {
635
    int[] numLayers = getNumLayers();
636
    return numLayers[0]==3 ? ListObjects.TRAJ_3.name() : ListObjects.TRAJ_4.name();
637
    }
638

    
639
///////////////////////////////////////////////////////////////////////////////////////////////////
640

    
641
  public ObjectSignature getSignature()
642
    {
643
    int[] numLayers = getNumLayers();
644

    
645
    switch(numLayers[0])
646
      {
647
      case 3: return new ObjectSignature(ObjectConstants.TRAJ_3);
648
      case 4: return new ObjectSignature(ObjectConstants.TRAJ_4);
649
      }
650

    
651
    return null;
652
    }
653

    
654
///////////////////////////////////////////////////////////////////////////////////////////////////
655

    
656
  public String getObjectName()
657
    {
658
    int[] numLayers = getNumLayers();
659

    
660
    switch(numLayers[0])
661
      {
662
      case 3: return "Trajber's Octahedron";
663
      case 4: return "Trajber 4x4";
664
      }
665

    
666
    return null;
667
    }
668

    
669
///////////////////////////////////////////////////////////////////////////////////////////////////
670

    
671
  public String getInventor()
672
    {
673
    int[] numLayers = getNumLayers();
674

    
675
    switch(numLayers[0])
676
      {
677
      case 3: return "Josef Trajber";
678
      case 4: return "Jürgen Brandt";
679
      }
680

    
681
    return null;
682
    }
683

    
684
///////////////////////////////////////////////////////////////////////////////////////////////////
685

    
686
  public int getYearOfInvention()
687
    {
688
    int[] numLayers = getNumLayers();
689
    return numLayers[0]==3 ? 1982 : 2001;
690
    }
691

    
692
///////////////////////////////////////////////////////////////////////////////////////////////////
693

    
694
  public float getComplexity()
695
    {
696
    int[] numLayers = getNumLayers();
697
    return numLayers[0]==3 ? 2.53f : 3.51f;
698
    }
699

    
700
///////////////////////////////////////////////////////////////////////////////////////////////////
701

    
702
  public String[][] getTutorials()
703
    {
704
    int[] numLayers = getNumLayers();
705

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

    
729
    return null;
730
    }
731
}
(54-54/57)