Project

General

Profile

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

distorted-objectlib / src / main / java / org / distorted / objectlib / objects / TwistyTrajber.java @ 5d09301e

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.ObjectFaceShape;
15
import org.distorted.objectlib.helpers.ObjectShape;
16
import org.distorted.objectlib.helpers.ObjectSignature;
17
import org.distorted.objectlib.main.InitData;
18
import org.distorted.objectlib.scrambling.ScrambleState;
19
import org.distorted.objectlib.main.ObjectType;
20
import org.distorted.objectlib.main.ShapeOctahedron;
21
import org.distorted.objectlib.touchcontrol.TouchControlOctahedron;
22

    
23
import java.io.InputStream;
24

    
25
import static org.distorted.objectlib.touchcontrol.TouchControl.TC_OCTAHEDRON;
26
import static org.distorted.objectlib.touchcontrol.TouchControl.TYPE_NOT_SPLIT;
27

    
28
///////////////////////////////////////////////////////////////////////////////////////////////////
29

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

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

    
44
  private ScrambleState[] mStates;
45
  private int[][] mBasicAngle;
46
  private float[][] mCuts;
47
  private float[][] mPositions;
48
  private int[] mQuatIndex;
49

    
50
///////////////////////////////////////////////////////////////////////////////////////////////////
51

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

    
57
///////////////////////////////////////////////////////////////////////////////////////////////////
58

    
59
  @Override
60
  public int[][] getSolvedQuats()
61
    {
62
    int[] numLayers = getNumLayers();
63
    int numL = numLayers[0];
64

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

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

    
90
///////////////////////////////////////////////////////////////////////////////////////////////////
91

    
92
  public ScrambleState[] getScrambleStates()
93
    {
94
    if( mStates==null )
95
      {
96
      int[][] m = new int[16][];
97

    
98
      for(int i=0; i<16; i++) m[i] = new int[] { 0,-1,i,0,1,i,0,2,i, 1,-1,i,1,1,i,1,2,i, 2,-1,i,2,1,i,2,2,i};
99

    
100
      mStates = new ScrambleState[]
101
          {
102
          new ScrambleState( new int[][] { m[ 1], m[ 2], m[ 3] } ),  //  0 0
103
          new ScrambleState( new int[][] {  null, m[ 4], m[ 5] } ),  //  1 x
104
          new ScrambleState( new int[][] { m[ 6],  null, m[ 7] } ),  //  2 y
105
          new ScrambleState( new int[][] { m[ 8], m[ 9],  null } ),  //  3 z
106
          new ScrambleState( new int[][] { m[10],  null, m[ 7] } ),  //  4 xy
107
          new ScrambleState( new int[][] { m[11], m[ 9],  null } ),  //  5 xz
108
          new ScrambleState( new int[][] {  null, m[12], m[ 5] } ),  //  6 yx
109
          new ScrambleState( new int[][] { m[ 8], m[13],  null } ),  //  7 yz
110
          new ScrambleState( new int[][] {  null, m[ 4], m[14] } ),  //  8 zx
111
          new ScrambleState( new int[][] { m[ 6],  null, m[15] } ),  //  9 zy
112
          new ScrambleState( new int[][] {  null,  null, m[ 5] } ),  // 10 xyx
113
          new ScrambleState( new int[][] {  null, m[ 4],  null } ),  // 11 xzx
114
          new ScrambleState( new int[][] {  null,  null, m[ 7] } ),  // 12 yxy
115
          new ScrambleState( new int[][] { m[ 6],  null,  null } ),  // 13 yzy
116
          new ScrambleState( new int[][] {  null, m[ 9],  null } ),  // 14 zxz
117
          new ScrambleState( new int[][] { m[ 8],  null,  null } ),  // 15 zyz
118
          };
119
      }
120

    
121
    return mStates;
122
    }
123

    
124
///////////////////////////////////////////////////////////////////////////////////////////////////
125

    
126
  public float[][] getCuts(int[] numLayers)
127
    {
128
    if( mCuts==null )
129
      {
130
      float[] tmp;
131

    
132
      if( numLayers[0]==3 )
133
        {
134
        final float cut= CUT3*numLayers[0]*SQ2/2;
135
        tmp = new float[] {-cut,+cut};
136
        }
137
      else
138
        {
139
        final float cut= CUT4*numLayers[0]*SQ2/2;
140
        tmp = new float[] {-cut,0,+cut};
141
        }
142

    
143
      mCuts = new float[][] { tmp,tmp,tmp };
144
      }
145

    
146
    return mCuts;
147
    }
148

    
149
///////////////////////////////////////////////////////////////////////////////////////////////////
150

    
151
  public boolean[][] getLayerRotatable(int[] numLayers)
152
    {
153
    int numL = numLayers[0];
154
    boolean[] tmp = new boolean[numL];
155
    for(int i=0; i<numL; i++) tmp[i] = true;
156
    return new boolean[][] { tmp,tmp,tmp };
157
    }
158

    
159
///////////////////////////////////////////////////////////////////////////////////////////////////
160

    
161
  public int getTouchControlType()
162
    {
163
    return TC_OCTAHEDRON;
164
    }
165

    
166
///////////////////////////////////////////////////////////////////////////////////////////////////
167

    
168
  public int getTouchControlSplit()
169
    {
170
    return TYPE_NOT_SPLIT;
171
    }
172

    
173
///////////////////////////////////////////////////////////////////////////////////////////////////
174

    
175
  public int[][][] getEnabled()
176
    {
177
    return new int[][][]
178
      {
179
          {{0,1,2}},{{0,1,2}},{{0,1,2}},{{0,1,2}},{{0,1,2}},{{0,1,2}},{{0,1,2}},{{0,1,2}}
180
      };
181
    }
182

    
183
///////////////////////////////////////////////////////////////////////////////////////////////////
184

    
185
  public float[] getDist3D(int[] numLayers)
186
    {
187
    return TouchControlOctahedron.D3D;
188
    }
189

    
190
///////////////////////////////////////////////////////////////////////////////////////////////////
191

    
192
  public Static3D[] getFaceAxis()
193
    {
194
    return TouchControlOctahedron.FACE_AXIS;
195
    }
196

    
197
///////////////////////////////////////////////////////////////////////////////////////////////////
198

    
199
  public float[][] getCubitPositions(int[] numLayers)
200
    {
201
    if( mPositions==null )
202
      {
203
      int numL = numLayers[0];
204
      float LEN = numL*0.5f;
205

    
206
      if( numL==3 )
207
        {
208
        mPositions = new float[][]
209
            {
210
              {  -LEN,       0,   LEN},
211
              {   LEN,       0,  -LEN},
212
              {   LEN,       0,   LEN},
213
              {  -LEN,       0,  -LEN},
214
              {     0, SQ2*LEN,     0},
215
              {     0,-SQ2*LEN,     0},
216

    
217
              {     0,     0,   LEN},
218
              {   LEN,     0,     0},
219
              {  -LEN,     0,     0},
220
              {     0,     0,  -LEN},
221
              {-LEN/2, (SQ2/2)*LEN, LEN/2},
222
              { LEN/2, (SQ2/2)*LEN,-LEN/2},
223
              {-LEN/2,-(SQ2/2)*LEN, LEN/2},
224
              { LEN/2,-(SQ2/2)*LEN,-LEN/2},
225
              { LEN/2, (SQ2/2)*LEN, LEN/2},
226
              { LEN/2,-(SQ2/2)*LEN, LEN/2},
227
              {-LEN/2, (SQ2/2)*LEN,-LEN/2},
228
              {-LEN/2,-(SQ2/2)*LEN,-LEN/2},
229

    
230
              {       0, SQ2*LEN/3, 2*LEN/3},
231
              { 2*LEN/3, SQ2*LEN/3,       0},
232
              {       0,-SQ2*LEN/3, 2*LEN/3},
233
              { 2*LEN/3,-SQ2*LEN/3,       0},
234
              {-2*LEN/3, SQ2*LEN/3,       0},
235
              {       0, SQ2*LEN/3,-2*LEN/3},
236
              {-2*LEN/3,-SQ2*LEN/3,       0},
237
              {       0,-SQ2*LEN/3,-2*LEN/3},
238
            };
239
        }
240
      else
241
        {
242
        final float A = 0.5f*SQ2*CUT4*LEN;
243
        final float B =     CUT4*LEN;
244
        final float C = CUT4/2;
245
        final float D =-1.5f*C+0.5f;
246
        final float E = 0.5f*C+0.5f;
247
        final float F = (SQ2/2)*(1-C);
248
        final float G = C*SQ2;
249
        final float H = 1-C;
250
        final float I = LEN-0.5f*B;
251
        final float J = SQ2*(LEN-B);
252

    
253
        mPositions = new float[][]
254
            {
255
              {  -I+B,  A,  I   },
256
              {  -I+B, -A,  I   },
257
              {   I  ,  A, -I+B },
258
              {   I  , -A, -I+B },
259
              {   I-B, -A, -I   },
260
              {   I-B,  A, -I   },
261
              {   I  ,  A,  I-B },
262
              {   I  , -A,  I-B },
263
              {   I-B, -A,  I   },
264
              {   I-B,  A,  I   },
265
              {  -I  , -A, -I+B },
266
              {  -I  ,  A, -I+B },
267
              {  -I+B,  A, -I   },
268
              {  -I+B, -A, -I   },
269
              {     B,  J,  0   },
270
              {    -B,  J,  0   },
271
              {     0,  J,  B   },
272
              {     0,  J, -B   },
273
              {     B, -J,  0   },
274
              {    -B, -J,  0   },
275
              {     0, -J,  B   },
276
              {     0, -J, -B   },
277
              {  -I  , -A,  I-B },
278
              {  -I  ,  A,  I-B },
279

    
280
              {     0, G*LEN, H*LEN},
281
              {     0,-G*LEN, H*LEN},
282
              { H*LEN, G*LEN,     0},
283
              { H*LEN,-G*LEN,     0},
284
              {-H*LEN, G*LEN,     0},
285
              {-H*LEN,-G*LEN,     0},
286
              {     0, G*LEN,-H*LEN},
287
              {     0,-G*LEN,-H*LEN},
288

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

    
298
              {+D*LEN, F*LEN,+E*LEN},
299
              {+E*LEN, F*LEN,+D*LEN},
300
              {+D*LEN,-F*LEN,+E*LEN},
301
              {+E*LEN,-F*LEN,+D*LEN},
302
              {-D*LEN, F*LEN,-E*LEN},
303
              {-E*LEN, F*LEN,-D*LEN},
304
              {-D*LEN,-F*LEN,-E*LEN},
305
              {-E*LEN,-F*LEN,-D*LEN},
306

    
307
              {       0, SQ2*LEN/3, 2*LEN/3},
308
              { 2*LEN/3, SQ2*LEN/3,       0},
309
              {       0,-SQ2*LEN/3, 2*LEN/3},
310
              { 2*LEN/3,-SQ2*LEN/3,       0},
311
              {-2*LEN/3, SQ2*LEN/3,       0},
312
              {       0, SQ2*LEN/3,-2*LEN/3},
313
              {-2*LEN/3,-SQ2*LEN/3,       0},
314
              {       0,-SQ2*LEN/3,-2*LEN/3},
315
            };
316
        }
317
      }
318

    
319
    return mPositions;
320
    }
321

    
322
///////////////////////////////////////////////////////////////////////////////////////////////////
323

    
324
  public Static4D getCubitQuats(int cubit, int[] numLayers)
325
    {
326
    if( mQuatIndex==null )
327
      {
328
      if( numLayers[0]==3 )
329
        {
330
        mQuatIndex = new int[] { 0, 2, 6, 4, 1, 3,
331
                                 0, 2, 8, 5, 7,19, 9,18, 1, 3,14,11,
332
                                 0, 1, 3, 2, 7, 5, 8,16 };
333
        }
334
      else
335
        {
336
        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,
337
                                 0,17, 6, 2, 4, 8, 5,16,15, 7,19,13, 9,22,23,18,21, 1, 3,12,10,14,11,20,
338
                                 0, 1, 3, 2, 7, 5, 8,16 };
339
        }
340
      }
341

    
342
    return mObjectQuats[mQuatIndex[cubit]];
343
    }
344

    
345
///////////////////////////////////////////////////////////////////////////////////////////////////
346

    
347
  public ObjectShape getObjectShape(int variant)
348
    {
349
    float numL = getNumLayers()[0];
350
    final float LEN = numL*0.5f;
351
    final float CUT = numL==3 ? CUT3 : CUT4;
352

    
353
    if( variant==0 )
354
      {
355
      final float A = SQ2*CUT*LEN;
356
      final float B =     CUT*LEN;
357

    
358
      float[][] vertices = numL==3 ?
359

    
360
        new float[][]
361
          {
362
             {    0,    0,    0},
363
             {    B,    A,   -B},
364
             {    B,   -A,   -B},
365
             {  2*B,    0,    0},
366
             {    0,    0, -2*B},
367
             {  3*B,    A,   -B},
368
             {  3*B,   -A,   -B},
369
             {    B,    A, -3*B},
370
             {    B,   -A, -3*B},
371

    
372
             {  LEN    ,  A, 2*B-LEN},
373
             {  LEN    , -A, 2*B-LEN},
374
             {  LEN-2*B,  A,    -LEN},
375
             {  LEN-2*B, -A,    -LEN},
376
          }
377
        :
378
        new float[][]
379
          {
380
             {  -1.5f*B,  -0.5f*A,  0.5f*B},
381
             {  -0.5f*B,   0.5f*A, -0.5f*B},
382
             {   0.5f*B,  -0.5f*A,  0.5f*B},
383
             {   1.5f*B,   0.5f*A, -0.5f*B},
384

    
385
             {  LEN-1.5f*B,  0.5f*A, 2.5f*B-LEN},
386
             {  LEN-2.5f*B,  0.5f*A, 1.5f*B-LEN},
387
             {  LEN-2.5f*B, -0.5f*A, 1.5f*B-LEN},
388
             {  LEN-1.5f*B, -0.5f*A, 2.5f*B-LEN},
389
          };
390

    
391
      int[][] indices = numL==3 ?
392

    
393
        new int[][]
394
          {
395
             {0,3,5,1},
396
             {0,2,6,3},
397
             {0,4,8,2},
398
             {0,1,7,4},
399
             {3,6,10,9,5},
400
             {2,8,12,10,6},
401
             {4,7,11,12,8},
402
             {1,5,9,11,7},
403
             {9,10,12,11}
404
          }
405
        :
406
        new int[][]
407
          {
408
             {0,2,3,1},
409
             {2,7,4,3},
410
             {3,4,5,1},
411
             {0,1,5,6},
412
             {0,6,7,2},
413
             {7,6,5,4}
414
          };
415

    
416
      return new ObjectShape(vertices, indices);
417
      }
418
    if( variant==1 )
419
      {
420
      final float A = SQ2*CUT*LEN;
421
      final float B = LEN*(1-2*CUT);
422
      final float C = (SQ2/2)*A;
423

    
424
      float[][] vertices = numL==3 ?
425

    
426
        new float[][]
427
          {
428
             {    -B, 0,  0 },
429
             {  -B+C, A, -C },
430
             {  -B+C,-A, -C },
431
             {     B, 0,  0 },
432
             {   B-C, A, -C },
433
             {   B-C,-A, -C },
434
             {     0, A, -B },
435
             {     0,-A, -B },
436
          }
437
        :
438
        new float[][]
439
          {
440
             {    -B, -0.5f*A,    C/2 },
441
             {  -B+C, +0.5f*A,   -C/2 },
442
             {     B, -0.5f*A,    C/2 },
443
             {   B-C, +0.5f*A,   -C/2 },
444
             {     0, +0.5f*A, -B+C/2 },
445
             {     0, -0.5f*A, -B+C/2 }
446
          };
447

    
448
      int[][] indices = numL==3 ?
449

    
450
        new int[][]
451
          {
452
             {0,3,4,1},
453
             {0,2,5,3},
454
             {1,4,6},
455
             {2,7,5},
456
             {0,1,6,7,2},
457
             {3,5,7,6,4}
458
          }
459
        :
460
        new int[][]
461
          {
462
             {0,2,3,1},
463
             {1,3,4},
464
             {0,5,2},
465
             {0,1,4,5},
466
             {2,5,4,3}
467
          };
468

    
469
      return new ObjectShape(vertices, indices);
470
      }
471
    else
472
      {
473
      final float L = LEN*(1-3*CUT);
474

    
475
      float[][] vertices =
476
          {
477
             { -L, -(SQ2/3)*L,   L/3 },
478
             {  L, -(SQ2/3)*L,   L/3 },
479
             {  0,(2*SQ2/3)*L,-2*L/3 },
480
             {  0, -(SQ2/3)*L,-2*L/3 },
481
          };
482

    
483
      int[][] indices =
484
          {
485
             {0,1,2},
486
             {3,1,0},
487
             {0,2,3},
488
             {1,3,2},
489
          };
490

    
491
      return new ObjectShape(vertices, indices);
492
      }
493
    }
494

    
495
///////////////////////////////////////////////////////////////////////////////////////////////////
496

    
497
  public ObjectFaceShape getObjectFaceShape(int variant)
498
    {
499
    int numL = getNumLayers()[0];
500
    final float LEN = numL*0.5f;
501
    final float CUT = numL==3 ? CUT3 : CUT4;
502

    
503
    if( variant==0 )
504
      {
505
      float height = isInIconMode() ? 0.001f : 0.05f;
506
      float[][] bands   = { {height,35,0.15f,0.3f,4,1,1},{0.001f,35,0.15f,0.3f,4,1,1} };
507
      float[][] corners = { {0.03f,0.10f} };
508
      float[][] centers = { { LEN/2, 0.0f, -LEN/2} };
509
      int[] bandIndices = numL==3 ? new int[] { 0,0,0,0,1,1,1,1,1 } : new int[] { 0,1,1,1,1,1 };
510
      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 };
511
      return new ObjectFaceShape(bands,bandIndices,corners,indices,centers,indices,null);
512
      }
513
    if( variant==1 )
514
      {
515
      float height = isInIconMode() ? 0.001f : 0.03f;
516
      final float B = LEN*(1-2*CUT);
517
      float[][] bands   = { {height,35,0.15f,0.3f,3,1,1},{0.001f,35,0.15f,0.3f,3,1,1} };
518
      float[][] corners = { {0.02f,0.10f} };
519
      float[][] centers = { { 0, 0, -B} };
520
      int[] bandIndices = numL==3 ? new int[] { 0,0,1,1,1,1 }       : new int[] { 0,1,1,1,1 };
521
      int[] indices     = numL==3 ? new int[] { 0,0,0,0,0,0,-1,-1 } : new int[] { 0,0,0,0,-1,-1 };
522
      return new ObjectFaceShape(bands,bandIndices,corners,indices,centers,indices,null);
523
      }
524
    else
525
      {
526
      float height = isInIconMode() ? 0.001f : 0.03f;
527
      final float L = LEN*(1-3*CUT);
528
      float[][] bands   = { {height,35,0.15f,0.3f,4,1,1},{0.001f,35,0.15f,0.3f,4,0,0} };
529
      float[][] corners = { {0.02f,0.10f} };
530
      float[][] centers = { {0, -(SQ2/3)*L,-2*L/3} };
531
      int[] bandIndices = { 0,1,1,1 };
532
      int[] indices     = { 0,0,0,-1 };
533
      return new ObjectFaceShape(bands,bandIndices,corners,indices,centers,indices,null);
534
      }
535
    }
536

    
537
///////////////////////////////////////////////////////////////////////////////////////////////////
538

    
539
  public int getNumCubitVariants(int[] numLayers)
540
    {
541
    return 3;
542
    }
543

    
544
///////////////////////////////////////////////////////////////////////////////////////////////////
545

    
546
  public int getCubitVariant(int cubit, int[] numLayers)
547
    {
548
    if( numLayers[0]==3 ) return cubit< 6 ? 0 : cubit<18 ? 1 : 2;
549
    else                  return cubit<24 ? 0 : cubit<48 ? 1 : 2;
550
    }
551

    
552
///////////////////////////////////////////////////////////////////////////////////////////////////
553

    
554
  public float getStickerRadius()
555
    {
556
    return 0.12f;
557
    }
558

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

    
561
  public float getStickerStroke()
562
    {
563
    return isInIconMode() ? 0.20f : 0.10f;
564
    }
565

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

    
568
  public float[][] getStickerAngles()
569
    {
570
    return null;
571
    }
572

    
573
///////////////////////////////////////////////////////////////////////////////////////////////////
574
// PUBLIC API
575

    
576
  public Static3D[] getRotationAxis()
577
    {
578
    return ROT_AXIS;
579
    }
580

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

    
583
  public int[][] getBasicAngles()
584
    {
585
    if( mBasicAngle ==null )
586
      {
587
      int num = getNumLayers()[0];
588
      int[] tmp = new int[num];
589
      for(int i=0; i<num; i++) tmp[i] = 4;
590
      mBasicAngle = new int[][] { tmp,tmp,tmp };
591
      }
592

    
593
    return mBasicAngle;
594
    }
595

    
596
///////////////////////////////////////////////////////////////////////////////////////////////////
597

    
598
  public String getShortName()
599
    {
600
    int[] numLayers = getNumLayers();
601
    return numLayers[0]==3 ? ObjectType.TRAJ_3.name() : ObjectType.TRAJ_4.name();
602
    }
603

    
604
///////////////////////////////////////////////////////////////////////////////////////////////////
605

    
606
  public ObjectSignature getSignature()
607
    {
608
    int[] numLayers = getNumLayers();
609

    
610
    switch(numLayers[0])
611
      {
612
      case 3: return new ObjectSignature(ObjectType.TRAJ_3);
613
      case 4: return new ObjectSignature(ObjectType.TRAJ_4);
614
      }
615

    
616
    return null;
617
    }
618

    
619
///////////////////////////////////////////////////////////////////////////////////////////////////
620

    
621
  public String getObjectName()
622
    {
623
    int[] numLayers = getNumLayers();
624

    
625
    switch(numLayers[0])
626
      {
627
      case 3: return "Trajber's Octahedron";
628
      case 4: return "Trajber 4x4";
629
      }
630

    
631
    return null;
632
    }
633

    
634
///////////////////////////////////////////////////////////////////////////////////////////////////
635

    
636
  public String getInventor()
637
    {
638
    int[] numLayers = getNumLayers();
639

    
640
    switch(numLayers[0])
641
      {
642
      case 3: return "Josef Trajber";
643
      case 4: return "Jürgen Brandt";
644
      }
645

    
646
    return null;
647
    }
648

    
649
///////////////////////////////////////////////////////////////////////////////////////////////////
650

    
651
  public int getYearOfInvention()
652
    {
653
    int[] numLayers = getNumLayers();
654
    return numLayers[0]==3 ? 1982 : 2001;
655
    }
656

    
657
///////////////////////////////////////////////////////////////////////////////////////////////////
658

    
659
  public int getComplexity()
660
    {
661
    int[] numLayers = getNumLayers();
662
    return numLayers[0]==3 ? 2 : 3;
663
    }
664

    
665
///////////////////////////////////////////////////////////////////////////////////////////////////
666

    
667
  public String[][] getTutorials()
668
    {
669
    int[] numLayers = getNumLayers();
670

    
671
    switch(numLayers[0])
672
      {
673
      case 3: return new String[][] {
674
                                     {"gb","Q2NSiuJWVvk","Trajber and UFO Tutorial","SuperAntoniovivaldi"},
675
                                     {"es","FPBirEJ8ZfY","Resolver Octaedro 3x3","Solución Rubik"},
676
                                     {"de","FjQXlwJGniQ","Trajbers Octahedron Tutorial","GerCubing"},
677
                                     {"br","kO3nMpZKv3Q","Resolver Octaedro Trajber","Rafael Cinoto"},
678
                                    };
679
      case 4: return new String[][] {
680
                                     {"gb","FZlw68I7snM","4x4 Trajber's Tutorial (1/2)","SuperAntoniovivaldi"},
681
                                     {"gb","VM0XFu7gAII","4x4 Trajber's Tutorial (2/2)","SuperAntoniovivaldi"},
682
                                     {"es","Q8ljV-feLpU","Tutorial Octaedro 4x4 (1/2)","Dany Cuber"},
683
                                     {"es","QyWpDLa1eZQ","Tutorial Octaedro 4x4 (2/2)","Dany Cuber"},
684
                                     {"ru","ikUogVow-58","Как собрать Октаэдр 4х4","RBcuber"},
685
                                     {"fr","4hxZyMVGiTA","Résolution de l'Octaèdre 4x4","asthalis"},
686
                                     {"pl","oPBvAT9lwt4","Octahedron 4x4 TUTORIAL PL","MrUK"},
687
                                     {"br","0ZgaoQ6IS2w","Resolver o octaedro Trajber 4x4 (1/3)","Rafael Cinoto"},
688
                                     {"br","TjxTx3IJy6M","Resolver o octaedro Trajber 4x4 (2/3)","Rafael Cinoto"},
689
                                     {"br","E8k2TXfUS8g","Resolver o octaedro Trajber 4x4 (3/3)","Rafael Cinoto"},
690
                                     {"vn","yorULpIm6Yw","Tutorial N.22 - Octahedron 4x4","Duy Thích Rubik"},
691
                                    };
692
      }
693

    
694
    return null;
695
    }
696
}
(33-33/36)