Project

General

Profile

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

distorted-objectlib / src / main / java / org / distorted / objectlib / objects / TwistySkewb.java @ 1f264f3e

1
///////////////////////////////////////////////////////////////////////////////////////////////////
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
import static org.distorted.objectlib.touchcontrol.TouchControl.TC_HEXAHEDRON;
23
import static org.distorted.objectlib.touchcontrol.TouchControl.TYPE_SPLIT_CORNER;
24

    
25
import java.io.InputStream;
26

    
27
import org.distorted.library.type.Static3D;
28
import org.distorted.library.type.Static4D;
29

    
30
import org.distorted.objectlib.helpers.ObjectFaceShape;
31
import org.distorted.objectlib.touchcontrol.TouchControlHexahedron;
32
import org.distorted.objectlib.main.ObjectControl;
33
import org.distorted.objectlib.main.ObjectType;
34
import org.distorted.objectlib.helpers.ObjectShape;
35
import org.distorted.objectlib.helpers.ScrambleState;
36
import org.distorted.objectlib.main.ShapeHexahedron;
37

    
38
///////////////////////////////////////////////////////////////////////////////////////////////////
39

    
40
public class TwistySkewb extends ShapeHexahedron
41
{
42
  static final Static3D[] ROT_AXIS = new Static3D[]
43
         {
44
           new Static3D(+SQ3/3,+SQ3/3,+SQ3/3),
45
           new Static3D(+SQ3/3,+SQ3/3,-SQ3/3),
46
           new Static3D(+SQ3/3,-SQ3/3,+SQ3/3),
47
           new Static3D(+SQ3/3,-SQ3/3,-SQ3/3)
48
         };
49

    
50
  private ScrambleState[] mStates;
51
  private int[] mBasicAngle;
52
  private Static4D[] mQuats;
53
  private float[][] mCuts;
54
  private int[][] mCornerMap,mEdgeMap,mCenterMap;
55

    
56
///////////////////////////////////////////////////////////////////////////////////////////////////
57

    
58
  public TwistySkewb(int[] numL, int meshState, Static4D quat, Static3D move, float scale, InputStream stream)
59
    {
60
    super(numL, meshState, 2*numL[0]-2, quat, move, scale, stream);
61
    }
62

    
63
///////////////////////////////////////////////////////////////////////////////////////////////////
64

    
65
  public ScrambleState[] getScrambleStates()
66
    {
67
    if( mStates==null )
68
      {
69
      int[] numLayers = getNumLayers();
70
      int numL = numLayers[0];
71

    
72
      int[] tmp = {0,-1,0, 0,1,0, numL-1,-1,0, numL-1,1,0 };
73

    
74
      mStates = new ScrambleState[]
75
        {
76
        new ScrambleState( new int[][] {tmp,tmp,tmp,tmp} )
77
        };
78
      }
79

    
80
    return mStates;
81
    }
82

    
83
///////////////////////////////////////////////////////////////////////////////////////////////////
84

    
85
  private void initializeQuats()
86
    {
87
    mQuats = new Static4D[]
88
         {
89
         new Static4D(  0.0f,  0.0f,  0.0f,  1.0f ),
90
         new Static4D(  1.0f,  0.0f,  0.0f,  0.0f ),
91
         new Static4D(  0.0f,  1.0f,  0.0f,  0.0f ),
92
         new Static4D(  0.0f,  0.0f,  1.0f,  0.0f ),
93

    
94
         new Static4D(  0.5f,  0.5f,  0.5f,  0.5f ),
95
         new Static4D(  0.5f,  0.5f,  0.5f, -0.5f ),
96
         new Static4D(  0.5f,  0.5f, -0.5f,  0.5f ),
97
         new Static4D(  0.5f,  0.5f, -0.5f, -0.5f ),
98
         new Static4D(  0.5f, -0.5f,  0.5f,  0.5f ),
99
         new Static4D(  0.5f, -0.5f,  0.5f, -0.5f ),
100
         new Static4D(  0.5f, -0.5f, -0.5f,  0.5f ),
101
         new Static4D(  0.5f, -0.5f, -0.5f, -0.5f )
102
         };
103
    }
104

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

    
107
  public int[] getSolvedQuats(int cubit, int[] numLayers)
108
    {
109
    if( mQuats==null ) initializeQuats();
110
    int status = retCubitSolvedStatus(cubit,numLayers);
111
    return status<0 ? null : buildSolvedQuats(TouchControlHexahedron.FACE_AXIS[status],mQuats);
112
    }
113

    
114
///////////////////////////////////////////////////////////////////////////////////////////////////
115

    
116
  private int getNumCorners()
117
    {
118
    return 8;
119
    }
120

    
121
///////////////////////////////////////////////////////////////////////////////////////////////////
122

    
123
  private int getNumEdges(int numLayers)
124
    {
125
    return (numLayers-2)*12;
126
    }
127

    
128
///////////////////////////////////////////////////////////////////////////////////////////////////
129

    
130
  private int getNumCentersPerFace(int numLayers)
131
    {
132
    return ((numLayers-2)*(numLayers-2) + (numLayers-1)*(numLayers-1));
133
    }
134

    
135
///////////////////////////////////////////////////////////////////////////////////////////////////
136

    
137
  public Static4D[] getQuats()
138
    {
139
    if( mQuats==null ) initializeQuats();
140
    return mQuats;
141
    }
142

    
143
///////////////////////////////////////////////////////////////////////////////////////////////////
144

    
145
  public int getSolvedFunctionIndex()
146
    {
147
    return 0;
148
    }
149

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

    
152
  public float[][] getCuts(int[] numLayers)
153
    {
154
    if( mCuts==null )
155
      {
156
      float[] c = numLayers[0]==2 ? (new float[] {0.0f}) : (new float[] {-SQ3/6,+SQ3/6});
157
      mCuts = new float[][] {c,c,c,c};
158
      }
159

    
160
    return mCuts;
161
    }
162

    
163
///////////////////////////////////////////////////////////////////////////////////////////////////
164

    
165
  public boolean[][] getLayerRotatable(int[] numLayers)
166
    {
167
    int numAxis = ROT_AXIS.length;
168
    boolean[] tmp = numLayers[0]==2 ? (new boolean[] {true,true}) : (new boolean[] {true,false,true});
169
    boolean[][] layerRotatable = new boolean[numAxis][];
170
    for(int i=0; i<numAxis; i++) layerRotatable[i] = tmp;
171

    
172
    return layerRotatable;
173
    }
174

    
175
///////////////////////////////////////////////////////////////////////////////////////////////////
176

    
177
  public int getTouchControlType()
178
    {
179
    return TC_HEXAHEDRON;
180
    }
181

    
182
///////////////////////////////////////////////////////////////////////////////////////////////////
183

    
184
  public int getTouchControlSplit()
185
    {
186
    return TYPE_SPLIT_CORNER;
187
    }
188

    
189
///////////////////////////////////////////////////////////////////////////////////////////////////
190

    
191
  public int[][][] getEnabled()
192
    {
193
    return new int[][][]
194
      {
195
          {{0,1},{3,1},{2,3},{0,2}},
196
          {{2,3},{3,1},{0,1},{0,2}},
197
          {{1,2},{0,1},{0,3},{2,3}},
198
          {{1,2},{2,3},{0,3},{0,1}},
199
          {{0,3},{0,2},{1,2},{1,3}},
200
          {{1,2},{0,2},{0,3},{1,3}},
201
      };
202
    }
203

    
204
///////////////////////////////////////////////////////////////////////////////////////////////////
205

    
206
  public float[] getDist3D(int[] numLayers)
207
    {
208
    return null;
209
    }
210

    
211
///////////////////////////////////////////////////////////////////////////////////////////////////
212

    
213
  public float[][] getCubitPositions(int[] numLayers)
214
    {
215
    int numL = numLayers[0];
216
    final float DIST_CORNER = numL-1;
217
    final float DIST_EDGE   = numL-1;
218
    final float DIST_CENTER = numL-1;
219

    
220
    final int numCorners = getNumCorners();
221
    final int numEdges   = getNumEdges(numL);
222
    final int numCenters = 6*getNumCentersPerFace(numL);
223

    
224
    final float[][] CENTERS = new float[numCorners+numEdges+numCenters][];
225

    
226
    /// CORNERS //////////////////////////////////////////////
227

    
228
    CENTERS[0] = new float[] { DIST_CORNER, DIST_CORNER, DIST_CORNER };
229
    CENTERS[1] = new float[] { DIST_CORNER, DIST_CORNER,-DIST_CORNER };
230
    CENTERS[2] = new float[] { DIST_CORNER,-DIST_CORNER, DIST_CORNER };
231
    CENTERS[3] = new float[] { DIST_CORNER,-DIST_CORNER,-DIST_CORNER };
232
    CENTERS[4] = new float[] {-DIST_CORNER, DIST_CORNER, DIST_CORNER };
233
    CENTERS[5] = new float[] {-DIST_CORNER, DIST_CORNER,-DIST_CORNER };
234
    CENTERS[6] = new float[] {-DIST_CORNER,-DIST_CORNER, DIST_CORNER };
235
    CENTERS[7] = new float[] {-DIST_CORNER,-DIST_CORNER,-DIST_CORNER };
236

    
237
    /// CENTERS //////////////////////////////////////////////
238

    
239
    int index=8;
240

    
241
    final float X= -1000.0f;
242
    final float Y= -1001.0f;
243

    
244
    final float[][]  centerTable =
245
        {
246
            {+DIST_CENTER,X,Y},
247
            {-DIST_CENTER,X,Y},
248
            {X,+DIST_CENTER,Y},
249
            {X,-DIST_CENTER,Y},
250
            {X,Y,+DIST_CENTER},
251
            {X,Y,-DIST_CENTER}
252
        };
253

    
254
    float x,y, cen0, cen1, cen2;
255

    
256
    for( float[] centers : centerTable )
257
      {
258
      x = 2-numL;
259

    
260
      for(int i=0; i<numL-1; i++, x+=2)
261
        {
262
        y = 2-numL;
263

    
264
        for(int j=0; j<numL-1; j++, y+=2, index++)
265
          {
266
               if( centers[0]==Y ) cen0 = y;
267
          else if( centers[0]==X ) cen0 = x;
268
          else                     cen0 = centers[0];
269

    
270
               if( centers[1]==Y ) cen1 = y;
271
          else if( centers[1]==X ) cen1 = x;
272
          else                     cen1 = centers[1];
273

    
274
               if( centers[2]==Y ) cen2 = y;
275
          else if( centers[2]==X ) cen2 = x;
276
          else                     cen2 = centers[2];
277

    
278
          CENTERS[index] = new float[] {cen0,cen1,cen2};
279
          }
280
        }
281

    
282
      x = 3-numL;
283

    
284
      for(int i=0; i<numL-2; i++, x+=2)
285
        {
286
        y = 3-numL;
287

    
288
        for(int j=0; j<numL-2; j++, y+=2, index++)
289
          {
290
               if( centers[0]==Y ) cen0 = y;
291
          else if( centers[0]==X ) cen0 = x;
292
          else                     cen0 = centers[0];
293

    
294
               if( centers[1]==Y ) cen1 = y;
295
          else if( centers[1]==X ) cen1 = x;
296
          else                     cen1 = centers[1];
297

    
298
               if( centers[2]==Y ) cen2 = y;
299
          else if( centers[2]==X ) cen2 = x;
300
          else                     cen2 = centers[2];
301

    
302
          CENTERS[index] = new float[] {cen0,cen1,cen2};
303
          }
304
        }
305
      }
306

    
307
    /// EDGES ///////////////////////////////////////////////
308

    
309
    final float[][]  edgeTable =
310
        {
311
            {0,+DIST_EDGE,+DIST_EDGE},
312
            {+DIST_EDGE,0,+DIST_EDGE},
313
            {0,-DIST_EDGE,+DIST_EDGE},
314
            {-DIST_EDGE,0,+DIST_EDGE},
315
            {+DIST_EDGE,+DIST_EDGE,0},
316
            {+DIST_EDGE,-DIST_EDGE,0},
317
            {-DIST_EDGE,-DIST_EDGE,0},
318
            {-DIST_EDGE,+DIST_EDGE,0},
319
            {0,+DIST_EDGE,-DIST_EDGE},
320
            {+DIST_EDGE,0,-DIST_EDGE},
321
            {0,-DIST_EDGE,-DIST_EDGE},
322
            {-DIST_EDGE,0,-DIST_EDGE}
323
        };
324

    
325
    for (float[] edges : edgeTable)
326
      {
327
      float c = 3-numL;
328

    
329
      for (int j=0; j<numL-2; j++, c+=2, index++)
330
        {
331
        CENTERS[index] = new float[] { edges[0]==0 ? c : edges[0] ,
332
                                       edges[1]==0 ? c : edges[1] ,
333
                                       edges[2]==0 ? c : edges[2] };
334
        }
335
      }
336

    
337
    return CENTERS;
338
    }
339

    
340
///////////////////////////////////////////////////////////////////////////////////////////////////
341

    
342
  public Static4D getQuat(int cubit, int[] numLayers)
343
    {
344
    if( mQuats==null ) initializeQuats();
345

    
346
    int numL = numLayers[0];
347
    int numCorners = getNumCorners();
348
    int numCentersPerFace = getNumCentersPerFace(numL);
349
    int numCenters = 6*numCentersPerFace;
350

    
351
    if( cubit<numCorners )
352
      {
353
      switch(cubit)
354
        {
355
        case  0: return mQuats[0];                         //  unit quat
356
        case  1: return new Static4D( SQ2/2,0,0,SQ2/2);    //  90 along X
357
        case  2: return new Static4D(-SQ2/2,0,0,SQ2/2);    // -90 along X
358
        case  3: return mQuats[1];                         // 180 along X
359
        case  4: return new Static4D(0, SQ2/2,0,SQ2/2);    //  90 along Y
360
        case  5: return mQuats[2];                         // 180 along Y
361
        case  6: return mQuats[3];                         // 180 along Z
362
        case  7: return new Static4D(SQ2/2,0,-SQ2/2,0);    // 180 along (SQ2/2,0,-SQ2/2)
363
        }
364
      }
365
    else if( cubit<numCorners+numCenters )
366
      {
367
      int center = (cubit-numCorners)/numCentersPerFace;
368

    
369
      switch(center)
370
        {
371
        case 0: return new Static4D(0,-SQ2/2,0,SQ2/2);    // -90 along Y
372
        case 1: return new Static4D(0, SQ2/2,0,SQ2/2);    //  90 along Y
373
        case 2: return new Static4D( SQ2/2,0,0,SQ2/2);    //  90 along X
374
        case 3: return new Static4D(-SQ2/2,0,0,SQ2/2);    // -90 along X
375
        case 4: return mQuats[0];                         //  unit quaternion
376
        case 5: return mQuats[1];                         // 180 along X
377
        }
378
      }
379
    else
380
      {
381
      int edge = (cubit-numCorners-numCenters)/(numL-2);
382

    
383
      switch(edge)
384
        {
385
        case  0: return mQuats[ 0];
386
        case  1: return mQuats[ 5];
387
        case  2: return mQuats[ 3];
388
        case  3: return mQuats[11];
389
        case  4: return mQuats[ 4];
390
        case  5: return mQuats[ 7];
391
        case  6: return mQuats[ 9];
392
        case  7: return mQuats[10];
393
        case  8: return mQuats[ 2];
394
        case  9: return mQuats[ 8];
395
        case 10: return mQuats[ 1];
396
        case 11: return mQuats[ 6];
397
        }
398
      }
399

    
400
    return null;
401
    }
402

    
403
///////////////////////////////////////////////////////////////////////////////////////////////////
404

    
405
  public ObjectShape getObjectShape(int variant)
406
    {
407
    if( variant==0 )
408
      {
409
      float[][] vertices= { {-1,0,0},{0,-1,0},{0,0,-1},{-1,-1,-1},{0,0,0} };
410
      int[][] indices   = { {0,1,4},{2,0,4},{1,2,4},{3,1,0},{3,2,1},{3,0,2} };
411
      return new ObjectShape(vertices, indices, 3);
412
      }
413
    else if( variant==1 )
414
      {
415
      float[][] vertices= { {-1,0,0},{0,-1,0},{1,0,0},{0,1,0},{0,0,-1} };
416
      int[][] indices   = { {0,1,2,3},{4,1,0},{4,2,1},{4,3,2},{4,0,3} };
417
      return new ObjectShape(vertices, indices, 1);
418
      }
419
    else
420
      {
421
      float[][] vertices= { {-1,0,0},{1,0,0},{0,-1,0},{0,0,-1} };
422
      int[][] indices   = { {2,1,0},{3,0,1},{2,3,1},{3,2,0} };
423
      return new ObjectShape(vertices, indices, 2);
424
      }
425
    }
426

    
427
///////////////////////////////////////////////////////////////////////////////////////////////////
428

    
429
  public ObjectFaceShape getObjectFaceShape(int variant)
430
    {
431
    int numL = getNumLayers()[0];
432

    
433
    if( variant==0 )
434
      {
435
      int N = numL==2 ? 7:5;
436
      int E1= numL==2 ? 3:2;
437
      int E2= numL==2 ? 5:3;
438
      float[][] bands     = { {0.020f,35,0.16f,0.7f,N,E1,E1}, {0.000f, 0,1.00f,0.0f,3,1,E2} };
439
      int[] bandIndices   = { 0,0,0,1,1,1 };
440
      float[][] corners   = { {0.05f,0.25f}, {0.05f,0.20f} };
441
      int[] cornerIndices = { 1,1,1,0,0 };
442
      float[][] centers   = { {-0.5f, -0.5f, -0.5f} };
443
      int[] centerIndices = { 0,0,0,-1,0 };
444
      return new ObjectFaceShape(bands,bandIndices,corners,cornerIndices,centers,centerIndices,null);
445
      }
446
    else if( variant==1 )
447
      {
448
      int N = numL==2 ? 7:6;
449
      int E = numL==2 ? 3:1;
450
      float[][] bands     = { {0.04f,35,SQ2/8,0.9f,N,E,E}, {0.000f,0,1,0.0f,3,0,0} };
451
      int[] bandIndices   = { 0,1,1,1,1 };
452
      float[][] corners   = { {0.06f,0.15f} };
453
      int[] cornerIndices = { 0,0,0,0,0 };
454
      float[][] centers   = { {0,0,-0.4f} };
455
      int[] centerIndices = { 0,0,0,0,-1 };
456
      return new ObjectFaceShape(bands,bandIndices,corners,cornerIndices,centers,centerIndices,null);
457
      }
458
    else
459
      {
460
      int N = numL==2 ? 7:5;
461
      int E = numL==2 ? 5:2;
462
      float[][] bands     = { {0.035f,30,0.16f,0.8f,N,2,E}, {0.020f,45,0.16f,0.2f,3,1,2} };
463
      int[] bandIndices   = { 0,0,1,1 };
464
      float[][] corners   = { {0.07f,0.20f}, {0.02f,0.30f} };
465
      int[] cornerIndices = { 0,0,1,1 };
466
      float[][] centers   = { {0.0f, -0.5f, -0.5f} };
467
      int[] centerIndices = { 0,0,0,0 };
468
      return new ObjectFaceShape(bands,bandIndices,corners,cornerIndices,centers,centerIndices,null);
469
      }
470
    }
471

    
472
///////////////////////////////////////////////////////////////////////////////////////////////////
473

    
474
  public int getNumCubitVariants(int[] numLayers)
475
    {
476
    return numLayers[0]==2 ? 2:3;
477
    }
478

    
479
///////////////////////////////////////////////////////////////////////////////////////////////////
480

    
481
  public int getCubitVariant(int cubit, int[] numLayers)
482
    {
483
    return cubit<8 ? 0 : (cubit<8+6*getNumCentersPerFace(numLayers[0]) ? 1:2);
484
    }
485

    
486
///////////////////////////////////////////////////////////////////////////////////////////////////
487

    
488
  public int getCubitFaceColor(int cubit, int face, int[] numLayers)
489
    {
490
    if( mCornerMap==null || mEdgeMap==null || mCenterMap==null )
491
      {
492
      mCornerMap = new int[][]
493
         {
494
           { 4, 2, 0, -1,-1,-1 },
495
           { 2, 5, 0, -1,-1,-1 },
496
           { 3, 4, 0, -1,-1,-1 },
497
           { 5, 3, 0, -1,-1,-1 },
498
           { 1, 2, 4, -1,-1,-1 },
499
           { 5, 2, 1, -1,-1,-1 },
500
           { 4, 3, 1, -1,-1,-1 },
501
           { 1, 3, 5, -1,-1,-1 },
502
         };
503

    
504
      mEdgeMap = new int[][]
505
         {
506
           { 4, 2, -1,-1,-1,-1 },
507
           { 0, 4, -1,-1,-1,-1 },
508
           { 4, 3, -1,-1,-1,-1 },
509
           { 1, 4, -1,-1,-1,-1 },
510
           { 2, 0, -1,-1,-1,-1 },
511
           { 3, 0, -1,-1,-1,-1 },
512
           { 3, 1, -1,-1,-1,-1 },
513
           { 2, 1, -1,-1,-1,-1 },
514
           { 5, 2, -1,-1,-1,-1 },
515
           { 0, 5, -1,-1,-1,-1 },
516
           { 5, 3, -1,-1,-1,-1 },
517
           { 1, 5, -1,-1,-1,-1 }
518
         };
519

    
520
      mCenterMap = new int[][]
521
         {
522
           { 0, -1,-1,-1,-1,-1 },
523
           { 1, -1,-1,-1,-1,-1 },
524
           { 2, -1,-1,-1,-1,-1 },
525
           { 3, -1,-1,-1,-1,-1 },
526
           { 4, -1,-1,-1,-1,-1 },
527
           { 5, -1,-1,-1,-1,-1 },
528
         };
529
      }
530

    
531
    int numL = numLayers[0];
532
    int numCorners = getNumCorners();
533
    int numCentersPerFace = getNumCentersPerFace(numL);
534
    int numCenters = 6*numCentersPerFace;
535

    
536
    if( cubit<numCorners )
537
      {
538
      return mCornerMap[cubit][face];
539
      }
540
    else if( cubit<numCorners+numCenters )
541
      {
542
      int center = (cubit-numCorners)/numCentersPerFace;
543
      return mCenterMap[center][face];
544
      }
545
    else
546
      {
547
      int edge = (cubit-numCorners-numCenters)/(numL-2);
548
      return mEdgeMap[edge][face];
549
      }
550
    }
551

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

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

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

    
561
  public float getStickerStroke()
562
    {
563
    float stroke = 0.08f;
564

    
565
    if( ObjectControl.isInIconMode() )
566
      {
567
      int[] numLayers = getNumLayers();
568
      stroke *= (numLayers[0]==2 ? 2.0f : 2.7f);
569
      }
570

    
571
    return stroke;
572
    }
573

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

    
576
  public float[][] getStickerAngles()
577
    {
578
    return null;
579
    }
580

    
581
///////////////////////////////////////////////////////////////////////////////////////////////////
582
// PUBLIC API
583

    
584
  public Static3D[] getRotationAxis()
585
    {
586
    return ROT_AXIS;
587
    }
588

    
589
///////////////////////////////////////////////////////////////////////////////////////////////////
590

    
591
  public int[] getBasicAngle()
592
    {
593
    if( mBasicAngle ==null ) mBasicAngle = new int[] { 3,3,3,3 };
594
    return mBasicAngle;
595
    }
596

    
597
///////////////////////////////////////////////////////////////////////////////////////////////////
598

    
599
  public ObjectType intGetObjectType(int[] numLayers)
600
    {
601
    switch(numLayers[0])
602
      {
603
      case 2: return ObjectType.SKEW_2;
604
      case 3: return ObjectType.SKEW_3;
605
      }
606

    
607
    return ObjectType.SKEW_2;
608
    }
609

    
610
///////////////////////////////////////////////////////////////////////////////////////////////////
611

    
612
  public String getObjectName()
613
    {
614
    switch(getNumLayers()[0])
615
      {
616
      case 2: return "Skewb";
617
      case 3: return "Master Skewb";
618
      }
619
    return "Skewb";
620
    }
621

    
622
///////////////////////////////////////////////////////////////////////////////////////////////////
623

    
624
  public String getInventor()
625
    {
626
    switch(getNumLayers()[0])
627
      {
628
      case 2: return "Tony Durham";
629
      case 3: return "Katsuhiko Okamoto";
630
      }
631
    return "Tony Durham";
632
    }
633

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

    
636
  public int getYearOfInvention()
637
    {
638
    switch(getNumLayers()[0])
639
      {
640
      case 2: return 1982;
641
      case 3: return 2003;
642
      }
643
    return 1982;
644
    }
645

    
646
///////////////////////////////////////////////////////////////////////////////////////////////////
647

    
648
  public int getComplexity()
649
    {
650
    switch(getNumLayers()[0])
651
      {
652
      case 2: return 1;
653
      case 3: return 3;
654
      }
655
    return 5;
656
    }
657
}
(21-21/26)