Project

General

Profile

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

magiccube / src / main / java / org / distorted / objects / TwistyDiamond.java @ efa81f0c

1 ece1b58d Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
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 android.content.res.Resources;
23
24 f10a88a8 Leszek Koltunski
import org.distorted.helpers.ObjectShape;
25 9c06394a Leszek Koltunski
import org.distorted.helpers.ObjectSticker;
26 6cf89a3e Leszek Koltunski
import org.distorted.helpers.ScrambleState;
27 ece1b58d Leszek Koltunski
import org.distorted.library.main.DistortedEffects;
28
import org.distorted.library.main.DistortedTexture;
29
import org.distorted.library.mesh.MeshSquare;
30
import org.distorted.library.type.Static3D;
31
import org.distorted.library.type.Static4D;
32 6fd4a72c Leszek Koltunski
import org.distorted.main.R;
33 ece1b58d Leszek Koltunski
34
///////////////////////////////////////////////////////////////////////////////////////////////////
35
36 efa81f0c Leszek Koltunski
public class TwistyDiamond extends Twisty8
37 ece1b58d Leszek Koltunski
{
38
  // the four rotation axis of a Diamond. Must be normalized.
39
  static final Static3D[] ROT_AXIS = new Static3D[]
40
         {
41
           new Static3D(+SQ6/3,+SQ3/3,     0),
42
           new Static3D(-SQ6/3,+SQ3/3,     0),
43 cc99cf91 Leszek Koltunski
           new Static3D(     0,-SQ3/3,-SQ6/3),
44
           new Static3D(     0,-SQ3/3,+SQ6/3)
45 ece1b58d Leszek Koltunski
         };
46
47 91792184 Leszek Koltunski
  private ScrambleState[] mStates;
48 aec5cc91 Leszek Koltunski
  private int[] mBasicAngle;
49
  private int[] mFaceMap;
50
  private Static4D[] mQuats;
51
  private int[] mTetraToFaceMap;
52
  private ObjectSticker[] mStickers;
53 e9a87113 Leszek Koltunski
  private Movement mMovement;
54 486b3417 Leszek Koltunski
55 ece1b58d Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
56
57 9c2f0c91 Leszek Koltunski
  TwistyDiamond(int size, Static4D quat, DistortedTexture texture,
58
                MeshSquare mesh, DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
59 ece1b58d Leszek Koltunski
    {
60 db875721 Leszek Koltunski
    super(size, size, quat, texture, mesh, effects, moves, ObjectList.DIAM, res, scrWidth);
61 91792184 Leszek Koltunski
    }
62 486b3417 Leszek Koltunski
63 91792184 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
64 486b3417 Leszek Koltunski
65 91792184 Leszek Koltunski
  ScrambleState[] getScrambleStates()
66
    {
67
    if( mStates==null )
68 486b3417 Leszek Koltunski
      {
69 91792184 Leszek Koltunski
      int size = getNumLayers();
70
      int[] tmp = new int[3*2*size];
71
72
      for(int i=0; i<2*size; i++)
73
        {
74
        tmp[3*i  ] = (i<size) ?  i:i-size;
75
        tmp[3*i+1] = (i%2==0) ? -1:1;
76
        tmp[3*i+2] = 0;
77
        }
78
79
      mStates = new ScrambleState[]
80
        {
81
        new ScrambleState( new int[][] {tmp,tmp,tmp,tmp} )
82
        };
83 486b3417 Leszek Koltunski
      }
84
85 91792184 Leszek Koltunski
    return mStates;
86 ece1b58d Leszek Koltunski
    }
87
88 aec5cc91 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
89
90
  private void initializeQuats()
91
    {
92
    mQuats = new Static4D[]
93
         {
94
          new Static4D(  0.0f,  0.0f,   0.0f,  1.0f ),
95
          new Static4D(  0.0f,  1.0f,   0.0f,  0.0f ),
96
          new Static4D(+SQ2/2,  0.0f, -SQ2/2,  0.0f ),
97
          new Static4D(-SQ2/2,  0.0f, -SQ2/2,  0.0f ),
98
99
          new Static4D(+SQ2/2,  0.5f,   0.0f,  0.5f ),
100
          new Static4D(-SQ2/2,  0.5f,   0.0f,  0.5f ),
101
          new Static4D(  0.0f,  0.5f, +SQ2/2,  0.5f ),
102
          new Static4D(  0.0f,  0.5f, -SQ2/2,  0.5f ),
103
          new Static4D(+SQ2/2,  0.5f,   0.0f, -0.5f ),
104
          new Static4D(-SQ2/2,  0.5f,   0.0f, -0.5f ),
105
          new Static4D(  0.0f,  0.5f, +SQ2/2, -0.5f ),
106
          new Static4D(  0.0f,  0.5f, -SQ2/2, -0.5f )
107
         };
108
    }
109
110 a480ee80 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
111
112
  int[] getSolvedQuats(int cubit, int numLayers)
113
    {
114 aec5cc91 Leszek Koltunski
    if( mQuats==null ) initializeQuats();
115
    if( mFaceMap==null ) mFaceMap = new int[] {4,0,6,2,7,3,5,1};
116 a480ee80 Leszek Koltunski
    int status = retCubitSolvedStatus(cubit,numLayers);
117 aec5cc91 Leszek Koltunski
    return status<0 ? null : buildSolvedQuats(MovementDiamond.FACE_AXIS[mFaceMap[status]],mQuats);
118 a480ee80 Leszek Koltunski
    }
119
120 ece1b58d Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
121
122
  Static4D[] getQuats()
123
    {
124 aec5cc91 Leszek Koltunski
    if( mQuats==null ) initializeQuats();
125
    return mQuats;
126 ece1b58d Leszek Koltunski
    }
127
128 169219a7 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
129
130
  int getSolvedFunctionIndex()
131
    {
132
    return 0;
133
    }
134
135 ece1b58d Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
136
137 a64e07d0 Leszek Koltunski
  int getNumStickerTypes(int numLayers)
138 ece1b58d Leszek Koltunski
    {
139 aec5cc91 Leszek Koltunski
    return 1;
140 ece1b58d Leszek Koltunski
    }
141
142
///////////////////////////////////////////////////////////////////////////////////////////////////
143
144 e6734aa9 Leszek Koltunski
  float[][] getCuts(int numLayers)
145 ece1b58d Leszek Koltunski
    {
146 680f921e Leszek Koltunski
    if( numLayers<2 )
147
      {
148
      return null;
149
      }
150
    else
151
      {
152 e6734aa9 Leszek Koltunski
      float[][] cuts = new float[4][numLayers-1];
153 5da517d3 Leszek Koltunski
      float dist = SQ6/3;
154 680f921e Leszek Koltunski
      float cut  = 0.5f*dist*(2-numLayers);
155
156
      for(int i=0; i<numLayers-1; i++)
157
        {
158 e6734aa9 Leszek Koltunski
        cuts[0][i] = cut;
159
        cuts[1][i] = cut;
160
        cuts[2][i] = cut;
161
        cuts[3][i] = cut;
162 680f921e Leszek Koltunski
        cut += dist;
163
        }
164
165
      return cuts;
166
      }
167 ece1b58d Leszek Koltunski
    }
168
169
///////////////////////////////////////////////////////////////////////////////////////////////////
170
171
  int getNumCubitFaces()
172
    {
173 efa81f0c Leszek Koltunski
    return 8;
174 ece1b58d Leszek Koltunski
    }
175
176
///////////////////////////////////////////////////////////////////////////////////////////////////
177
178 680f921e Leszek Koltunski
  private int getNumOctahedrons(int layers)
179
    {
180
    return layers==1 ? 1 : 4*(layers-1)*(layers-1) + 2;
181
    }
182
183
///////////////////////////////////////////////////////////////////////////////////////////////////
184
185
  private int getNumTetrahedrons(int layers)
186
    {
187
    return 4*layers*(layers-1);
188
    }
189
190
///////////////////////////////////////////////////////////////////////////////////////////////////
191
192 31cd7256 Leszek Koltunski
  private int createOctaPositions(float[][] centers, int index, int layers, float height)
193 680f921e Leszek Koltunski
    {
194 5da517d3 Leszek Koltunski
    float x = (layers-1)*0.5f;
195
    float z = (layers+1)*0.5f;
196 680f921e Leszek Koltunski
197
    for(int i=0; i<layers; i++, index++)
198
      {
199 5da517d3 Leszek Koltunski
      z -= 1;
200 680f921e Leszek Koltunski
      centers[index][0] = x;
201
      centers[index][1] = height;
202
      centers[index][2] = z;
203
      }
204
205
    for(int i=0; i<layers-1; i++, index++)
206
      {
207 5da517d3 Leszek Koltunski
      x -= 1;
208 680f921e Leszek Koltunski
      centers[index][0] = x;
209
      centers[index][1] = height;
210
      centers[index][2] = z;
211
      }
212
213
    for(int i=0; i<layers-1; i++, index++)
214
      {
215 5da517d3 Leszek Koltunski
      z += 1;
216 680f921e Leszek Koltunski
      centers[index][0] = x;
217
      centers[index][1] = height;
218
      centers[index][2] = z;
219
      }
220
221
    for(int i=0; i<layers-2; i++, index++)
222
      {
223 5da517d3 Leszek Koltunski
      x += 1;
224 680f921e Leszek Koltunski
      centers[index][0] = x;
225
      centers[index][1] = height;
226
      centers[index][2] = z;
227
      }
228
229
    return index;
230
    }
231
232
///////////////////////////////////////////////////////////////////////////////////////////////////
233
234 31cd7256 Leszek Koltunski
  private int createTetraPositions(float[][] centers, int index, int layers, float height)
235 ece1b58d Leszek Koltunski
    {
236 5da517d3 Leszek Koltunski
    float x = (layers-1)*0.5f;
237
    float z =  layers*0.5f;
238 680f921e Leszek Koltunski
239
    for(int i=0; i<layers-1; i++, index++)
240
      {
241 5da517d3 Leszek Koltunski
      z -= 1;
242 680f921e Leszek Koltunski
      centers[index][0] = x;
243
      centers[index][1] = height;
244
      centers[index][2] = z;
245
      }
246
247 5da517d3 Leszek Koltunski
    x += 0.5f;
248
    z -= 0.5f;
249 680f921e Leszek Koltunski
250
    for(int i=0; i<layers-1; i++, index++)
251
      {
252 5da517d3 Leszek Koltunski
      x -= 1;
253 680f921e Leszek Koltunski
      centers[index][0] = x;
254
      centers[index][1] = height;
255
      centers[index][2] = z;
256
      }
257
258 5da517d3 Leszek Koltunski
    x -= 0.5f;
259
    z -= 0.5f;
260 680f921e Leszek Koltunski
261
    for(int i=0; i<layers-1; i++, index++)
262
      {
263 5da517d3 Leszek Koltunski
      z += 1;
264 680f921e Leszek Koltunski
      centers[index][0] = x;
265
      centers[index][1] = height;
266
      centers[index][2] = z;
267
      }
268
269 5da517d3 Leszek Koltunski
    x -= 0.5f;
270
    z += 0.5f;
271 680f921e Leszek Koltunski
272
    for(int i=0; i<layers-1; i++, index++)
273
      {
274 5da517d3 Leszek Koltunski
      x += 1;
275 680f921e Leszek Koltunski
      centers[index][0] = x;
276
      centers[index][1] = height;
277
      centers[index][2] = z;
278
      }
279
280
    return index;
281
    }
282
283
///////////////////////////////////////////////////////////////////////////////////////////////////
284
285
  float[][] getCubitPositions(int layers)
286
    {
287
    int numO = getNumOctahedrons(layers);
288
    int numT = getNumTetrahedrons(layers);
289
    int index = 0;
290
    float height = 0.0f;
291
292
    float[][] CENTERS = new float[numO+numT][3];
293
294 31cd7256 Leszek Koltunski
    index = createOctaPositions(CENTERS,index,layers,height);
295 680f921e Leszek Koltunski
296
    for(int i=layers-1; i>0; i--)
297
      {
298 5da517d3 Leszek Koltunski
      height += SQ2/2;
299 31cd7256 Leszek Koltunski
      index = createOctaPositions(CENTERS,index,i,+height);
300
      index = createOctaPositions(CENTERS,index,i,-height);
301 680f921e Leszek Koltunski
      }
302
303 5da517d3 Leszek Koltunski
    height = SQ2/4;
304 680f921e Leszek Koltunski
305
    for(int i=layers; i>1; i--)
306
      {
307 31cd7256 Leszek Koltunski
      index = createTetraPositions(CENTERS,index,i,+height);
308
      index = createTetraPositions(CENTERS,index,i,-height);
309 5da517d3 Leszek Koltunski
      height += SQ2/2;
310 680f921e Leszek Koltunski
      }
311
312 ece1b58d Leszek Koltunski
    return CENTERS;
313
    }
314
315
///////////////////////////////////////////////////////////////////////////////////////////////////
316
317 680f921e Leszek Koltunski
  private int retFaceTetraBelongsTo(int tetra, int numLayers)
318 ece1b58d Leszek Koltunski
    {
319 aec5cc91 Leszek Koltunski
    if( mTetraToFaceMap==null ) mTetraToFaceMap = new int[] {1,2,3,0,5,6,7,4};
320
321 68b5f9c5 Leszek Koltunski
    for(int i=numLayers-1; i>0; i--)
322 ece1b58d Leszek Koltunski
      {
323 68b5f9c5 Leszek Koltunski
      if( tetra < 8*i ) return mTetraToFaceMap[tetra/i];
324
      tetra -= 8*i;
325 680f921e Leszek Koltunski
      }
326 68b5f9c5 Leszek Koltunski
327
    return -1;
328 680f921e Leszek Koltunski
    }
329
330 f10a88a8 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
331
332
  ObjectShape getObjectShape(int cubit, int numLayers)
333
    {
334
    int variant = getCubitVariant(cubit,numLayers);
335 f56b53cb Leszek Koltunski
    int N = numLayers>3 ? 5:6;
336 7d11f930 Leszek Koltunski
    int E = numLayers>2 ? (numLayers>3 ? 0:1):2;
337 ece1b58d Leszek Koltunski
338 f10a88a8 Leszek Koltunski
    if( variant==0 )
339 ece1b58d Leszek Koltunski
      {
340 aec5cc91 Leszek Koltunski
      double[][] vertices = new double[][]
341
          {
342
             { 0.5,   0.0, 0.5},
343
             { 0.5,   0.0,-0.5},
344
             {-0.5,   0.0,-0.5},
345
             {-0.5,   0.0, 0.5},
346
             { 0.0, SQ2/2, 0.0},
347
             { 0.0,-SQ2/2, 0.0}
348
          };
349
350
      int[][] vert_indices = new int[][]
351
          {
352
             {3,0,4},
353
             {0,1,4},
354
             {1,2,4},
355
             {2,3,4},
356
             {5,0,3},
357
             {5,1,0},
358
             {5,2,1},
359
             {5,3,2}
360
          };
361
362 f10a88a8 Leszek Koltunski
      float[][] bands     = new float[][] { {0.05f,35,0.5f,0.8f,N,E,E} };
363
      int[] bandIndices   = new int[] { 0,0,0,0,0,0,0,0 };
364
      float[][] corners   = new float[][] { {0.04f,0.20f} };
365
      int[] cornerIndices = new int[] { 0,0,0,0,0,0 };
366
      float[][] centers   = new float[][] { {0.0f, 0.0f, 0.0f} };
367
      int[] centerIndices = new int[] { 0,0,0,0,0,0 };
368 aec5cc91 Leszek Koltunski
      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
369 ece1b58d Leszek Koltunski
      }
370
    else
371
      {
372 aec5cc91 Leszek Koltunski
      double[][] vertices = new double[][] { {-0.5, SQ2/4, 0.0}, { 0.5, SQ2/4, 0.0}, { 0.0,-SQ2/4, 0.5}, { 0.0,-SQ2/4,-0.5} };
373
      int[][] vert_indices = new int[][]  { {2,1,0}, {2,3,1}, {3,2,0}, {3,0,1} };
374 f10a88a8 Leszek Koltunski
      float[][] bands     = new float[][] { {0.05f,35,0.5f,0.8f,N,E,E} };
375
      int[] bandIndices   = new int[] { 0,0,0,0 };
376
      float[][] corners   = new float[][] { {0.08f,0.15f} };
377
      int[] cornerIndices = new int[] { 0,0,0,0 };
378
      float[][] centers   = new float[][] { {0.0f, 0.0f, 0.0f} };
379
      int[] centerIndices = new int[] { 0,0,0,0 };
380 aec5cc91 Leszek Koltunski
      return new ObjectShape(vertices,vert_indices,bands,bandIndices,corners,cornerIndices,centers,centerIndices,getNumCubitFaces(), null);
381 f10a88a8 Leszek Koltunski
      }
382
    }
383
384
///////////////////////////////////////////////////////////////////////////////////////////////////
385
386 3e605536 Leszek Koltunski
  Static4D getQuat(int cubit, int numLayers)
387 f10a88a8 Leszek Koltunski
    {
388 aec5cc91 Leszek Koltunski
    if( mQuats==null ) initializeQuats();
389 3e605536 Leszek Koltunski
    int numO = getNumOctahedrons(numLayers);
390 f10a88a8 Leszek Koltunski
391 aec5cc91 Leszek Koltunski
    if( cubit<numO ) return mQuats[0];
392 f10a88a8 Leszek Koltunski
393 3e605536 Leszek Koltunski
    switch( retFaceTetraBelongsTo(cubit-numO, numLayers) )
394 f10a88a8 Leszek Koltunski
      {
395 aec5cc91 Leszek Koltunski
      case 0: return mQuats[0];                         // unit quat
396 3e605536 Leszek Koltunski
      case 1: return new Static4D(0,-SQ2/2,0,SQ2/2);    //  90 along Y
397 aec5cc91 Leszek Koltunski
      case 2: return mQuats[1];                         // 180 along Y
398 3e605536 Leszek Koltunski
      case 3: return new Static4D(0,+SQ2/2,0,SQ2/2);    //  90 along
399
      case 4: return new Static4D(0,     0,1,    0);    // 180 along Z
400
      case 5: return new Static4D(SQ2/2, 0,SQ2/2,0);    //
401
      case 6: return new Static4D(     1,0,0,    0);    // 180 along X
402
      case 7: return new Static4D(-SQ2/2,0,SQ2/2,0);    //
403 ece1b58d Leszek Koltunski
      }
404
405 3e605536 Leszek Koltunski
    return null;
406
    }
407
408
///////////////////////////////////////////////////////////////////////////////////////////////////
409 ece1b58d Leszek Koltunski
410 3e605536 Leszek Koltunski
  int getNumCubitVariants(int numLayers)
411
    {
412
    return 2;
413
    }
414
415
///////////////////////////////////////////////////////////////////////////////////////////////////
416
417
  int getCubitVariant(int cubit, int numLayers)
418
    {
419
    return cubit<getNumOctahedrons(numLayers) ? 0 : 1;
420 ece1b58d Leszek Koltunski
    }
421
422
///////////////////////////////////////////////////////////////////////////////////////////////////
423
424 2ef489e2 Leszek Koltunski
  int getFaceColor(int cubit, int cubitface, int size)
425 ece1b58d Leszek Koltunski
    {
426 2ef489e2 Leszek Koltunski
    int numO = getNumOctahedrons(size);
427 680f921e Leszek Koltunski
428
    if( cubit<numO )
429
      {
430 2ef489e2 Leszek Koltunski
      int axis = 0;
431
      int layer= 1;
432
433
      switch(cubitface)
434
        {
435
        case 0: axis = 2; layer =             1; break;
436
        case 1: axis = 0; layer = (1<<(size-1)); break;
437
        case 2: axis = 3; layer =             1; break;
438
        case 3: axis = 1; layer = (1<<(size-1)); break;
439
        case 4: axis = 3; layer = (1<<(size-1)); break;
440
        case 5: axis = 1; layer =             1; break;
441
        case 6: axis = 2; layer = (1<<(size-1)); break;
442
        case 7: axis = 0; layer =             1; break;
443
        }
444
445 a4962b9c Leszek Koltunski
      return CUBITS[cubit].mRotationRow[axis] == layer ? cubitface : NUM_TEXTURES;
446 680f921e Leszek Koltunski
      }
447
    else
448
      {
449 a4962b9c Leszek Koltunski
      return cubitface>0 ? NUM_TEXTURES : retFaceTetraBelongsTo(cubit-numO, size);
450 680f921e Leszek Koltunski
      }
451 ece1b58d Leszek Koltunski
    }
452
453 9c06394a Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
454 76c2bd07 Leszek Koltunski
455 9c06394a Leszek Koltunski
  ObjectSticker retSticker(int face)
456
    {
457 aec5cc91 Leszek Koltunski
    if( mStickers==null )
458
      {
459
      float[][] STICKERS = new float[][] { { -0.4330127f, -0.25f, 0.4330127f, -0.25f, 0.0f, 0.5f } };
460
      float radius = 0.06f;
461
      float stroke = 0.07f;
462
      float[] radii = new float[] {radius,radius,radius};
463
      mStickers     = new ObjectSticker[STICKERS.length];
464
      mStickers[0]  = new ObjectSticker(STICKERS[0],null,radii,stroke);
465
      }
466
467 abf36986 Leszek Koltunski
    return mStickers[face/NUM_FACE_COLORS];
468 ece1b58d Leszek Koltunski
    }
469
470
///////////////////////////////////////////////////////////////////////////////////////////////////
471 e1dc3366 Leszek Koltunski
// PUBLIC API
472 ece1b58d Leszek Koltunski
473 e1dc3366 Leszek Koltunski
  public Static3D[] getRotationAxis()
474
    {
475
    return ROT_AXIS;
476
    }
477
478 e9a87113 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
479
480
  public Movement getMovement()
481
    {
482
    if( mMovement==null ) mMovement = new MovementDiamond();
483
    return mMovement;
484
    }
485
486 e1dc3366 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
487
488
  public int[] getBasicAngle()
489
    {
490 aec5cc91 Leszek Koltunski
    if( mBasicAngle ==null ) mBasicAngle = new int[] { 3,3,3,3 };
491
    return mBasicAngle;
492 e1dc3366 Leszek Koltunski
    }
493
494 6fd4a72c Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
495
496
  public int getObjectName(int numLayers)
497
    {
498 2ef489e2 Leszek Koltunski
    switch(numLayers)
499
      {
500
      case 2: return R.string.diam2;
501
      case 3: return R.string.diam3;
502 2adf1263 Leszek Koltunski
      case 4: return R.string.diam4;
503 2ef489e2 Leszek Koltunski
      }
504
505
    return 0;
506 6fd4a72c Leszek Koltunski
    }
507
508
///////////////////////////////////////////////////////////////////////////////////////////////////
509
510
  public int getInventor(int numLayers)
511
    {
512 2ef489e2 Leszek Koltunski
    switch(numLayers)
513
      {
514
      case 2: return R.string.diam2_inventor;
515
      case 3: return R.string.diam3_inventor;
516 2adf1263 Leszek Koltunski
      case 4: return R.string.diam4_inventor;
517 2ef489e2 Leszek Koltunski
      }
518
519
    return 0;
520 6fd4a72c Leszek Koltunski
    }
521
522
///////////////////////////////////////////////////////////////////////////////////////////////////
523
524
  public int getComplexity(int numLayers)
525
    {
526 2ef489e2 Leszek Koltunski
    switch(numLayers)
527
      {
528 2adf1263 Leszek Koltunski
      case 2: return 4;
529
      case 3: return 6;
530
      case 4: return 8;
531 2ef489e2 Leszek Koltunski
      }
532
533
    return 0;
534 6fd4a72c Leszek Koltunski
    }
535 ece1b58d Leszek Koltunski
}