Project

General

Profile

Download (20.6 KB) Statistics
| Branch: | Tag: | Revision:

magiccube / src / main / java / org / distorted / objects / TwistySkewb.java @ 7ee89540

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.objects;
21

    
22
import static org.distorted.objects.Movement.TYPE_SPLIT_CORNER;
23

    
24
import android.content.res.Resources;
25

    
26
import org.distorted.helpers.ObjectShape;
27
import org.distorted.helpers.ObjectSticker;
28
import org.distorted.helpers.ScrambleState;
29
import org.distorted.library.main.DistortedEffects;
30
import org.distorted.library.main.DistortedTexture;
31
import org.distorted.library.mesh.MeshSquare;
32
import org.distorted.library.type.Static3D;
33
import org.distorted.library.type.Static4D;
34
import org.distorted.main.R;
35

    
36
///////////////////////////////////////////////////////////////////////////////////////////////////
37

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

    
48
  private static final int[][][] ENABLED = new int[][][]
49
      {
50
          {{0,1},{3,1},{2,3},{0,2}},
51
          {{2,3},{3,1},{0,1},{0,2}},
52
          {{1,2},{0,1},{0,3},{2,3}},
53
          {{1,2},{2,3},{0,3},{0,1}},
54
          {{0,3},{0,2},{1,2},{1,3}},
55
          {{1,2},{0,2},{0,3},{1,3}},
56
      };
57

    
58
  private ScrambleState[] mStates;
59
  private int[] mBasicAngle;
60
  private Static4D[] mQuats;
61
  private float[][] mCuts;
62
  private boolean[][] mLayerRotatable;
63
  private int[][] mCornerMap,mEdgeMap,mCenterMap;
64
  private ObjectSticker[] mStickers;
65
  private Movement mMovement;
66

    
67
///////////////////////////////////////////////////////////////////////////////////////////////////
68

    
69
  TwistySkewb(int size, Static4D quat, DistortedTexture texture,
70
              MeshSquare mesh, DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
71
    {
72
    super(size, 2*size-2, quat, texture, mesh, effects, moves, ObjectList.SKEW, res, scrWidth);
73
    }
74

    
75
///////////////////////////////////////////////////////////////////////////////////////////////////
76

    
77
  ScrambleState[] getScrambleStates()
78
    {
79
    if( mStates==null )
80
      {
81
      int size = getNumLayers();
82
      int[] tmp = {0,-1,0, 0,1,0, size-1,-1,0, size-1,1,0 };
83

    
84
      mStates = new ScrambleState[]
85
        {
86
        new ScrambleState( new int[][] {tmp,tmp,tmp,tmp} )
87
        };
88
      }
89

    
90
    return mStates;
91
    }
92

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

    
95
  private void initializeQuats()
96
    {
97
    mQuats = new Static4D[]
98
         {
99
         new Static4D(  0.0f,  0.0f,  0.0f,  1.0f ),
100
         new Static4D(  1.0f,  0.0f,  0.0f,  0.0f ),
101
         new Static4D(  0.0f,  1.0f,  0.0f,  0.0f ),
102
         new Static4D(  0.0f,  0.0f,  1.0f,  0.0f ),
103

    
104
         new Static4D(  0.5f,  0.5f,  0.5f,  0.5f ),
105
         new Static4D(  0.5f,  0.5f,  0.5f, -0.5f ),
106
         new Static4D(  0.5f,  0.5f, -0.5f,  0.5f ),
107
         new Static4D(  0.5f,  0.5f, -0.5f, -0.5f ),
108
         new Static4D(  0.5f, -0.5f,  0.5f,  0.5f ),
109
         new Static4D(  0.5f, -0.5f,  0.5f, -0.5f ),
110
         new Static4D(  0.5f, -0.5f, -0.5f,  0.5f ),
111
         new Static4D(  0.5f, -0.5f, -0.5f, -0.5f )
112
         };
113
    }
114

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

    
117
  int[] getSolvedQuats(int cubit, int numLayers)
118
    {
119
    if( mQuats==null ) initializeQuats();
120
    int status = retCubitSolvedStatus(cubit,numLayers);
121
    return status<0 ? null : buildSolvedQuats(Movement6.FACE_AXIS[status],mQuats);
122
    }
123

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

    
126
  private int getNumCorners()
127
    {
128
    return 8;
129
    }
130

    
131
///////////////////////////////////////////////////////////////////////////////////////////////////
132

    
133
  private int getNumEdges(int layers)
134
    {
135
    return (layers-2)*12;
136
    }
137

    
138
///////////////////////////////////////////////////////////////////////////////////////////////////
139

    
140
  private int getNumCentersPerFace(int layers)
141
    {
142
    return ((layers-2)*(layers-2) + (layers-1)*(layers-1));
143
    }
144

    
145
///////////////////////////////////////////////////////////////////////////////////////////////////
146

    
147
  Static4D[] getQuats()
148
    {
149
    if( mQuats==null ) initializeQuats();
150
    return mQuats;
151
    }
152

    
153
///////////////////////////////////////////////////////////////////////////////////////////////////
154

    
155
  int getSolvedFunctionIndex()
156
    {
157
    return 0;
158
    }
159

    
160
///////////////////////////////////////////////////////////////////////////////////////////////////
161

    
162
  int getNumStickerTypes(int numLayers)
163
    {
164
    return 3;
165
    }
166

    
167
///////////////////////////////////////////////////////////////////////////////////////////////////
168

    
169
  float[][] getCuts(int numLayers)
170
    {
171
    if( mCuts==null )
172
      {
173
      float[] c = numLayers==2 ? (new float[] {0.0f}) : (new float[] {-SQ3/6,+SQ3/6});
174
      mCuts = new float[][] {c,c,c,c};
175
      }
176

    
177
    return mCuts;
178
    }
179

    
180
///////////////////////////////////////////////////////////////////////////////////////////////////
181

    
182
  private void getLayerRotatable(int numLayers)
183
    {
184
    if( mLayerRotatable==null )
185
      {
186
      int numAxis = ROT_AXIS.length;
187
      boolean[] tmp = numLayers==2 ? (new boolean[] {true,true}) : (new boolean[] {true,false,true});
188
      mLayerRotatable = new boolean[numAxis][];
189
      for(int i=0; i<numAxis; i++) mLayerRotatable[i] = tmp;
190
      }
191
    }
192

    
193
///////////////////////////////////////////////////////////////////////////////////////////////////
194

    
195
  int getNumCubitFaces()
196
    {
197
    return 6;
198
    }
199

    
200
///////////////////////////////////////////////////////////////////////////////////////////////////
201

    
202
  float[][] getCubitPositions(int numLayers)
203
    {
204
    final float DIST_CORNER = numLayers-1;
205
    final float DIST_EDGE   = numLayers-1;
206
    final float DIST_CENTER = numLayers-1;
207

    
208
    final int numCorners = getNumCorners();
209
    final int numEdges   = getNumEdges(numLayers);
210
    final int numCenters = 6*getNumCentersPerFace(numLayers);
211

    
212
    final float[][] CENTERS = new float[numCorners+numEdges+numCenters][];
213

    
214
    /// CORNERS //////////////////////////////////////////////
215

    
216
    CENTERS[0] = new float[] { DIST_CORNER, DIST_CORNER, DIST_CORNER };
217
    CENTERS[1] = new float[] { DIST_CORNER, DIST_CORNER,-DIST_CORNER };
218
    CENTERS[2] = new float[] { DIST_CORNER,-DIST_CORNER, DIST_CORNER };
219
    CENTERS[3] = new float[] { DIST_CORNER,-DIST_CORNER,-DIST_CORNER };
220
    CENTERS[4] = new float[] {-DIST_CORNER, DIST_CORNER, DIST_CORNER };
221
    CENTERS[5] = new float[] {-DIST_CORNER, DIST_CORNER,-DIST_CORNER };
222
    CENTERS[6] = new float[] {-DIST_CORNER,-DIST_CORNER, DIST_CORNER };
223
    CENTERS[7] = new float[] {-DIST_CORNER,-DIST_CORNER,-DIST_CORNER };
224

    
225
    /// EDGES ///////////////////////////////////////////////
226

    
227
    final float[][]  edgeTable =
228
        {
229
            {0,+DIST_EDGE,+DIST_EDGE},
230
            {+DIST_EDGE,0,+DIST_EDGE},
231
            {0,-DIST_EDGE,+DIST_EDGE},
232
            {-DIST_EDGE,0,+DIST_EDGE},
233
            {+DIST_EDGE,+DIST_EDGE,0},
234
            {+DIST_EDGE,-DIST_EDGE,0},
235
            {-DIST_EDGE,-DIST_EDGE,0},
236
            {-DIST_EDGE,+DIST_EDGE,0},
237
            {0,+DIST_EDGE,-DIST_EDGE},
238
            {+DIST_EDGE,0,-DIST_EDGE},
239
            {0,-DIST_EDGE,-DIST_EDGE},
240
            {-DIST_EDGE,0,-DIST_EDGE}
241
        };
242

    
243
    int index=8;
244

    
245
    for (float[] edges : edgeTable)
246
      {
247
      float c = 3-numLayers;
248

    
249
      for (int j=0; j<numLayers-2; j++, c+=2, index++)
250
        {
251
        CENTERS[index] = new float[] { edges[0]==0 ? c : edges[0] ,
252
                                       edges[1]==0 ? c : edges[1] ,
253
                                       edges[2]==0 ? c : edges[2] };
254
        }
255
      }
256

    
257
    /// CENTERS //////////////////////////////////////////////
258

    
259
    final float X= -1000.0f;
260
    final float Y= -1001.0f;
261

    
262
    final float[][]  centerTable =
263
        {
264
            {+DIST_CENTER,X,Y},
265
            {-DIST_CENTER,X,Y},
266
            {X,+DIST_CENTER,Y},
267
            {X,-DIST_CENTER,Y},
268
            {X,Y,+DIST_CENTER},
269
            {X,Y,-DIST_CENTER}
270
        };
271

    
272
    float x,y, cen0, cen1, cen2;
273

    
274
    for( float[] centers : centerTable )
275
      {
276
      x = 2-numLayers;
277

    
278
      for(int i=0; i<numLayers-1; i++, x+=2)
279
        {
280
        y = 2-numLayers;
281

    
282
        for(int j=0; j<numLayers-1; j++, y+=2, index++)
283
          {
284
               if( centers[0]==Y ) cen0 = y;
285
          else if( centers[0]==X ) cen0 = x;
286
          else                     cen0 = centers[0];
287

    
288
               if( centers[1]==Y ) cen1 = y;
289
          else if( centers[1]==X ) cen1 = x;
290
          else                     cen1 = centers[1];
291

    
292
               if( centers[2]==Y ) cen2 = y;
293
          else if( centers[2]==X ) cen2 = x;
294
          else                     cen2 = centers[2];
295

    
296
          CENTERS[index] = new float[] {cen0,cen1,cen2};
297
          }
298
        }
299

    
300
      x = 3-numLayers;
301

    
302
      for(int i=0; i<numLayers-2; i++, x+=2)
303
        {
304
        y = 3-numLayers;
305

    
306
        for(int j=0; j<numLayers-2; j++, y+=2, index++)
307
          {
308
               if( centers[0]==Y ) cen0 = y;
309
          else if( centers[0]==X ) cen0 = x;
310
          else                     cen0 = centers[0];
311

    
312
               if( centers[1]==Y ) cen1 = y;
313
          else if( centers[1]==X ) cen1 = x;
314
          else                     cen1 = centers[1];
315

    
316
               if( centers[2]==Y ) cen2 = y;
317
          else if( centers[2]==X ) cen2 = x;
318
          else                     cen2 = centers[2];
319

    
320
          CENTERS[index] = new float[] {cen0,cen1,cen2};
321
          }
322
        }
323
      }
324

    
325
    return CENTERS;
326
    }
327

    
328
///////////////////////////////////////////////////////////////////////////////////////////////////
329

    
330
  Static4D getQuat(int cubit, int numLayers)
331
    {
332
    if( mQuats==null ) initializeQuats();
333
    int numCorners = getNumCorners();
334
    int numEdges   = getNumEdges(numLayers);
335

    
336
    if( cubit<numCorners )
337
      {
338
      switch(cubit)
339
        {
340
        case  0: return mQuats[0];                         //  unit quat
341
        case  1: return new Static4D( SQ2/2,0,0,SQ2/2);    //  90 along X
342
        case  2: return new Static4D(-SQ2/2,0,0,SQ2/2);    // -90 along X
343
        case  3: return mQuats[1];                         // 180 along X
344
        case  4: return new Static4D(0, SQ2/2,0,SQ2/2);    //  90 along Y
345
        case  5: return mQuats[2];                         // 180 along Y
346
        case  6: return mQuats[3];                         // 180 along Z
347
        case  7: return new Static4D(SQ2/2,0,-SQ2/2,0);    // 180 along (SQ2/2,0,-SQ2/2)
348
        }
349
      }
350
    else if( cubit<numCorners+numEdges )
351
      {
352
      int edge = (cubit-numCorners)/(numLayers-2);
353

    
354
      switch(edge)
355
        {
356
        case  0: return mQuats[ 0];
357
        case  1: return mQuats[ 5];
358
        case  2: return mQuats[ 3];
359
        case  3: return mQuats[11];
360
        case  4: return mQuats[ 4];
361
        case  5: return mQuats[ 7];
362
        case  6: return mQuats[ 9];
363
        case  7: return mQuats[10];
364
        case  8: return mQuats[ 2];
365
        case  9: return mQuats[ 8];
366
        case 10: return mQuats[ 1];
367
        case 11: return mQuats[ 6];
368
        }
369
      }
370
    else
371
      {
372
      int center = (cubit-numCorners-numEdges)/getNumCentersPerFace(numLayers);
373

    
374
      switch(center)
375
        {
376
        case 0: return new Static4D(0,-SQ2/2,0,SQ2/2);    // -90 along Y
377
        case 1: return new Static4D(0, SQ2/2,0,SQ2/2);    //  90 along Y
378
        case 2: return new Static4D( SQ2/2,0,0,SQ2/2);    //  90 along X
379
        case 3: return new Static4D(-SQ2/2,0,0,SQ2/2);    // -90 along X
380
        case 4: return mQuats[0];                         //  unit quaternion
381
        case 5: return mQuats[1];                         // 180 along X
382
        }
383
      }
384

    
385
    return null;
386
    }
387

    
388
///////////////////////////////////////////////////////////////////////////////////////////////////
389

    
390
  ObjectShape getObjectShape(int cubit, int numLayers)
391
    {
392
    int variant = getCubitVariant(cubit,numLayers);
393

    
394
    if( variant==0 )
395
      {
396
      double[][] vertices = new double[][] { {-1,0,0},{0,-1,0},{0,0,-1},{-1,-1,-1},{0,0,0} };
397
      int[][] vert_indices = new int[][] { {0,1,4},{2,0,4},{1,2,4},{3,1,0},{3,2,1},{3,0,2} };
398
      int N = numLayers==2 ? 7:5;
399
      int E1= numLayers==2 ? 3:2;
400
      int E2= numLayers==2 ? 5:3;
401
      float[][] bands     = new float[][] { {0.020f,35,0.16f,0.7f,N,E1,E1}, {0.000f, 0,1.00f,0.0f,3,1,E2} };
402
      int[] bandIndices   = new int[] { 0,0,0,1,1,1 };
403
      float[][] corners   = new float[][] { {0.05f,0.25f}, {0.05f,0.20f} };
404
      int[] cornerIndices = new int[] { 1,1,1,0,0 };
405
      float[][] centers   = new float[][] { {-0.5f, -0.5f, -0.5f} };
406
      int[] centerIndices = new int[] { 0,0,0,-1,0 };
407
      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
408
      }
409
    else if( variant==1 )
410
      {
411
      double[][] vertices = new double[][] { {-1,0,0},{1,0,0},{0,-1,0},{0,0,-1} };
412
      int[][] vert_indices = new int[][] { {2,1,0},{3,0,1},{2,3,1},{3,2,0} };
413
      int N = numLayers==2 ? 7:5;
414
      int E = numLayers==2 ? 5:2;
415
      float[][] bands     = new float[][] { {0.035f,30,0.16f,0.8f,N,2,E}, {0.020f,45,0.16f,0.2f,3,1,2} };
416
      int[] bandIndices   = new int[] { 0,0,1,1 };
417
      float[][] corners   = new float[][] { {0.07f,0.20f}, {0.02f,0.30f} };
418
      int[] cornerIndices = new int[] { 0,0,1,1 };
419
      float[][] centers   = new float[][] { {0.0f, -0.5f, -0.5f} };
420
      int[] centerIndices = new int[] { 0,0,0,0 };
421
      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
422
      }
423
    else
424
      {
425
      double[][] vertices = new double[][] { {-1,0,0},{0,-1,0},{1,0,0},{0,1,0},{0,0,-1} };
426
      int[][] vert_indices = new int[][] { {0,1,2,3},{4,1,0},{4,2,1},{4,3,2},{4,0,3} };
427
      int N = numLayers==2 ? 7:6;
428
      int E = numLayers==2 ? 3:1;
429
      float[][] bands     = new float[][] { {0.04f,35,SQ2/8,0.9f,N,E,E}, {0.000f,0,1,0.0f,3,0,0} };
430
      int[] bandIndices   = new int[] { 0,1,1,1,1 };
431
      float[][] corners   = new float[][] { {0.06f,0.15f} };
432
      int[] cornerIndices = new int[] { 0,0,0,0,0 };
433
      float[][] centers   = new float[][] { {0,0,-0.4f} };
434
      int[] centerIndices = new int[] { 0,0,0,0,-1 };
435
      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
436
      }
437
    }
438

    
439
///////////////////////////////////////////////////////////////////////////////////////////////////
440

    
441
  int getNumCubitVariants(int numLayers)
442
    {
443
    return 3;
444
    }
445

    
446
///////////////////////////////////////////////////////////////////////////////////////////////////
447

    
448
  int getCubitVariant(int cubit, int numLayers)
449
    {
450
    int numCorners = getNumCorners();
451
    if( cubit<numCorners ) return 0;
452
    int numEdges = getNumEdges(numLayers);
453
    return cubit<numCorners+numEdges ? 1:2;
454
    }
455

    
456
///////////////////////////////////////////////////////////////////////////////////////////////////
457

    
458
  int getFaceColor(int cubit, int cubitface, int numLayers)
459
    {
460
    if( mCornerMap==null || mEdgeMap==null || mCenterMap==null )
461
      {
462
      mCornerMap = new int[][]
463
         {
464
           {  4, 2, 0, 18,18,18 },
465
           {  2, 5, 0, 18,18,18 },
466
           {  3, 4, 0, 18,18,18 },
467
           {  5, 3, 0, 18,18,18 },
468
           {  1, 2, 4, 18,18,18 },
469
           {  5, 2, 1, 18,18,18 },
470
           {  4, 3, 1, 18,18,18 },
471
           {  1, 3, 5, 18,18,18 },
472
         };
473

    
474
      mEdgeMap = new int[][]
475
         {
476
           { 10, 8, 18,18,18,18 },
477
           {  6,10, 18,18,18,18 },
478
           { 10, 9, 18,18,18,18 },
479
           {  7,10, 18,18,18,18 },
480
           {  8, 6, 18,18,18,18 },
481
           {  9, 6, 18,18,18,18 },
482
           {  9, 7, 18,18,18,18 },
483
           {  8, 7, 18,18,18,18 },
484
           { 11, 8, 18,18,18,18 },
485
           {  6,11, 18,18,18,18 },
486
           { 11, 9, 18,18,18,18 },
487
           {  7,11, 18,18,18,18 }
488
         };
489

    
490
      mCenterMap = new int[][]
491
         {
492
           { 12, 18,18,18,18,18 },
493
           { 13, 18,18,18,18,18 },
494
           { 14, 18,18,18,18,18 },
495
           { 15, 18,18,18,18,18 },
496
           { 16, 18,18,18,18,18 },
497
           { 17, 18,18,18,18,18 },
498
         };
499
      }
500

    
501
    int numCorners = getNumCorners();
502
    int numEdges   = getNumEdges(numLayers);
503

    
504
    if( cubit<numCorners )
505
      {
506
      return mCornerMap[cubit][cubitface];
507
      }
508
    else if( cubit<numCorners+numEdges )
509
      {
510
      int edge = (cubit-numCorners)/(numLayers-2);
511
      return mEdgeMap[edge][cubitface];
512
      }
513
    else
514
      {
515
      int center = (cubit-numCorners-numEdges)/getNumCentersPerFace(numLayers);
516
      return mCenterMap[center][cubitface];
517
      }
518
    }
519

    
520
///////////////////////////////////////////////////////////////////////////////////////////////////
521

    
522
  ObjectSticker retSticker(int face)
523
    {
524
    if( mStickers==null )
525
      {
526
      float[][] STICKERS = new float[][]
527
          {
528
             { -0.5f, 0.25f, 0.25f,  -0.5f, 0.25f, 0.25f  },
529
             { -0.5f, 0.00f, 0.00f,  -0.5f, 0.50f, 0.0f, 0.0f, 0.5f }
530
          };
531

    
532
      final float R1 = 0.025f;
533
      final float R2 = 0.025f;
534
      final float R3 = 0.055f;
535
      final float[][] radii  = { { R1,R1,R1 },{ R2,R2,R2 },{ R3,R3,R3,R3 } };
536
      final float[] strokes = { 0.045f, 0.035f, 0.035f };
537

    
538
      mStickers = new ObjectSticker[STICKERS.length+1];
539

    
540
      for(int s=0; s<STICKERS.length+1; s++)
541
        {
542
        int index = s<2 ? 0:1;
543
        mStickers[s] = new ObjectSticker(STICKERS[index],null,radii[s],strokes[s]);
544
        }
545
      }
546

    
547
    return mStickers[face/NUM_FACE_COLORS];
548
    }
549

    
550
///////////////////////////////////////////////////////////////////////////////////////////////////
551
// PUBLIC API
552

    
553
  public Static3D[] getRotationAxis()
554
    {
555
    return ROT_AXIS;
556
    }
557

    
558
///////////////////////////////////////////////////////////////////////////////////////////////////
559

    
560
  public Movement getMovement()
561
    {
562
    if( mMovement==null )
563
      {
564
      int numLayers = getNumLayers();
565
      if( mCuts==null ) getCuts(numLayers);
566
      getLayerRotatable(numLayers);
567
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,2*numLayers-2,TYPE_SPLIT_CORNER,ENABLED);
568
      }
569
    return mMovement;
570
    }
571

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

    
574
  public int[] getBasicAngle()
575
    {
576
    if( mBasicAngle ==null ) mBasicAngle = new int[] { 3,3,3,3 };
577
    return mBasicAngle;
578
    }
579

    
580
///////////////////////////////////////////////////////////////////////////////////////////////////
581

    
582
  public int getObjectName(int numLayers)
583
    {
584
    switch(numLayers)
585
      {
586
      case 2: return R.string.skew2;
587
      case 3: return R.string.skew3;
588
      }
589
    return R.string.skew2;
590
    }
591

    
592
///////////////////////////////////////////////////////////////////////////////////////////////////
593

    
594
  public int getInventor(int numLayers)
595
    {
596
    switch(numLayers)
597
      {
598
      case 2: return R.string.skew2_inventor;
599
      case 3: return R.string.skew3_inventor;
600
      }
601
    return R.string.skew2_inventor;
602
    }
603

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

    
606
  public int getComplexity(int numLayers)
607
    {
608
    switch(numLayers)
609
      {
610
      case 2: return 4;
611
      case 3: return 8;
612
      }
613
    return 5;
614
    }
615
}
(34-34/38)