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.TouchControlDodecahedron.COS54;
|
23
|
import static org.distorted.objectlib.touchcontrol.TouchControlDodecahedron.SIN54;
|
24
|
|
25
|
import java.io.InputStream;
|
26
|
|
27
|
import org.distorted.library.type.Static3D;
|
28
|
import org.distorted.library.type.Static4D;
|
29
|
import org.distorted.library.main.QuatHelper;
|
30
|
|
31
|
import org.distorted.objectlib.helpers.ObjectFaceShape;
|
32
|
import org.distorted.objectlib.helpers.ObjectSignature;
|
33
|
import org.distorted.objectlib.main.ObjectType;
|
34
|
import org.distorted.objectlib.helpers.ObjectShape;
|
35
|
|
36
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
37
|
|
38
|
public class TwistyMegaminx extends TwistyMinx
|
39
|
{
|
40
|
static final float MEGA_D = 0.04f;
|
41
|
private int[] mQuatCenterIndices;
|
42
|
|
43
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
44
|
|
45
|
public TwistyMegaminx(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
46
|
{
|
47
|
super(numL, meshState, iconMode, quat, move, scale, stream);
|
48
|
}
|
49
|
|
50
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
51
|
|
52
|
private void initializeCenterIndices()
|
53
|
{
|
54
|
mQuatCenterIndices = new int[] { 0, 35, 55, 38, 48, 41, 42, 58, 57, 46, 29, 59 };
|
55
|
}
|
56
|
|
57
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
58
|
|
59
|
private int numCubitsPerCorner(int numLayers)
|
60
|
{
|
61
|
return 3*((numLayers-1)/2)*((numLayers-3)/2) + 1;
|
62
|
}
|
63
|
|
64
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
65
|
|
66
|
private int numCubitsPerEdge(int numLayers)
|
67
|
{
|
68
|
return numLayers-2;
|
69
|
}
|
70
|
|
71
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
72
|
|
73
|
public float[][] getCuts(int[] numLayers)
|
74
|
{
|
75
|
return genericGetCuts(numLayers[0],0.5f-MEGA_D);
|
76
|
}
|
77
|
|
78
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
79
|
|
80
|
private float[] computeCenter(int center, int numLayers)
|
81
|
{
|
82
|
if( mCenterCoords==null ) initializeCenterCoords();
|
83
|
float[] coords = mCenterCoords[center];
|
84
|
float A = (float)numLayers/3;
|
85
|
|
86
|
return new float[] { A*coords[0], A*coords[1], A*coords[2] };
|
87
|
}
|
88
|
|
89
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
90
|
// Fill out mCurrCorner{X,Y,Z} by applying appropriate Quat to mBasicCorner{X,Y,Z}
|
91
|
// Appropriate one: QUATS[QUAT_INDICES[corner]].
|
92
|
|
93
|
private void computeBasicCornerVectors(int corner)
|
94
|
{
|
95
|
if( mQuatCornerIndices==null ) initializeQuatIndices();
|
96
|
if( mCurrCornerV==null || mBasicCornerV==null ) initializeCornerV();
|
97
|
|
98
|
Static4D quat = mObjectQuats[mQuatCornerIndices[corner]];
|
99
|
|
100
|
mCurrCornerV[0] = QuatHelper.rotateVectorByQuat(mBasicCornerV[0],quat);
|
101
|
mCurrCornerV[1] = QuatHelper.rotateVectorByQuat(mBasicCornerV[1],quat);
|
102
|
mCurrCornerV[2] = QuatHelper.rotateVectorByQuat(mBasicCornerV[2],quat);
|
103
|
}
|
104
|
|
105
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
106
|
|
107
|
private float[] computeCorner(int numCubitsPerCorner, int numLayers, int corner, int part)
|
108
|
{
|
109
|
if( mCorners==null ) initializeCorners();
|
110
|
if( mCurrCornerV==null || mBasicCornerV==null ) initializeCornerV();
|
111
|
|
112
|
float D = numLayers/3.0f;
|
113
|
float[] corn = mCorners[corner];
|
114
|
|
115
|
if( part==0 )
|
116
|
{
|
117
|
return new float[] { corn[0]*D, corn[1]*D, corn[2]*D };
|
118
|
}
|
119
|
else
|
120
|
{
|
121
|
float E = 2.0f*D*(0.5f-MEGA_D)/(0.5f*(numLayers-1));
|
122
|
int N = (numCubitsPerCorner-1)/3;
|
123
|
int block = (part-1) % N;
|
124
|
int index = (part-1) / N;
|
125
|
Static4D pri = mCurrCornerV[index];
|
126
|
Static4D sec = mCurrCornerV[(index+2)%3];
|
127
|
|
128
|
int layers= (numLayers-3)/2;
|
129
|
int multP = (block % layers) + 1;
|
130
|
int multS = (block / layers);
|
131
|
|
132
|
return new float[] {
|
133
|
corn[0]*D + (pri.get0()*multP + sec.get0()*multS)*E,
|
134
|
corn[1]*D + (pri.get1()*multP + sec.get1()*multS)*E,
|
135
|
corn[2]*D + (pri.get2()*multP + sec.get2()*multS)*E
|
136
|
};
|
137
|
}
|
138
|
}
|
139
|
|
140
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
141
|
|
142
|
private int computeEdgeType(int cubit, int numCubitsPerCorner, int numCubitsPerEdge)
|
143
|
{
|
144
|
int part = (cubit - NUM_CORNERS*numCubitsPerCorner) % numCubitsPerEdge;
|
145
|
return (part+1)/2;
|
146
|
}
|
147
|
|
148
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
149
|
|
150
|
private float[] computeEdge(int numLayers, int edge, int part)
|
151
|
{
|
152
|
if( mCenterCoords==null ) initializeCenterCoords();
|
153
|
if( mCorners==null ) initializeCorners();
|
154
|
if( mEdgeMap==null ) initializeEdgeMap();
|
155
|
|
156
|
float D = numLayers/3.0f;
|
157
|
float[] c1 = mCorners[ mEdgeMap[edge][0] ];
|
158
|
float[] c2 = mCorners[ mEdgeMap[edge][1] ];
|
159
|
float x = D * (c1[0]+c2[0]) / 2;
|
160
|
float y = D * (c1[1]+c2[1]) / 2;
|
161
|
float z = D * (c1[2]+c2[2]) / 2;
|
162
|
|
163
|
if( part==0 )
|
164
|
{
|
165
|
return new float[] { x, y, z };
|
166
|
}
|
167
|
else
|
168
|
{
|
169
|
int mult = (part+1)/2;
|
170
|
int dir = (part+1)%2;
|
171
|
float[] center = mCenterCoords[ mEdgeMap[edge][dir+2] ];
|
172
|
|
173
|
float vX = D*center[0] - x;
|
174
|
float vY = D*center[1] - y;
|
175
|
float vZ = D*center[2] - z;
|
176
|
|
177
|
float A = 3*mult*D*(0.5f-MEGA_D)*COS18/((numLayers-1)*0.5f);
|
178
|
A /= (float)Math.sqrt(vX*vX+vY*vY+vZ*vZ);
|
179
|
|
180
|
return new float[] { x+A*vX, y+A*vY, z+A*vZ };
|
181
|
}
|
182
|
}
|
183
|
|
184
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
185
|
|
186
|
public float[][] getCubitPositions(int[] numLayers)
|
187
|
{
|
188
|
int numL = numLayers[0];
|
189
|
int numCubitsPerCorner = numCubitsPerCorner(numL);
|
190
|
int numCubitsPerEdge = numCubitsPerEdge(numL);
|
191
|
int numCubits = NUM_CORNERS*numCubitsPerCorner + NUM_EDGES*numCubitsPerEdge + NUM_CENTERS;
|
192
|
int index=0;
|
193
|
|
194
|
final float[][] CENTERS = new float[numCubits][];
|
195
|
|
196
|
for(int corner=0; corner<NUM_CORNERS; corner++)
|
197
|
{
|
198
|
computeBasicCornerVectors(corner);
|
199
|
|
200
|
for(int part=0; part<numCubitsPerCorner; part++, index++)
|
201
|
{
|
202
|
CENTERS[index] = computeCorner(numCubitsPerCorner,numL,corner,part);
|
203
|
}
|
204
|
}
|
205
|
|
206
|
for(int edge=0; edge<NUM_EDGES; edge++)
|
207
|
{
|
208
|
for(int part=0; part<numCubitsPerEdge; part++, index++)
|
209
|
{
|
210
|
CENTERS[index] = computeEdge(numL, edge, part );
|
211
|
}
|
212
|
}
|
213
|
|
214
|
for(int center=0; center<NUM_CENTERS; center++, index++)
|
215
|
{
|
216
|
CENTERS[index] = computeCenter(center, numL);
|
217
|
}
|
218
|
|
219
|
return CENTERS;
|
220
|
}
|
221
|
|
222
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
223
|
|
224
|
public Static4D getCubitQuats(int cubit, int[] numLayers)
|
225
|
{
|
226
|
int numL = numLayers[0];
|
227
|
int numCubitsPerCorner = numCubitsPerCorner(numL);
|
228
|
int numCubitsPerEdge = numCubitsPerEdge(numL);
|
229
|
|
230
|
return mObjectQuats[getQuat(cubit,numCubitsPerCorner,numCubitsPerEdge)];
|
231
|
}
|
232
|
|
233
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
234
|
|
235
|
private int getQuat(int cubit, int numCubitsPerCorner, int numCubitsPerEdge)
|
236
|
{
|
237
|
if( mQuatCornerIndices==null || mQuatEdgeIndices==null ) initializeQuatIndices();
|
238
|
if( mQuatCenterIndices==null ) initializeCenterIndices();
|
239
|
|
240
|
if( cubit < NUM_CORNERS*numCubitsPerCorner )
|
241
|
{
|
242
|
int corner = cubit/numCubitsPerCorner;
|
243
|
return mQuatCornerIndices[corner];
|
244
|
}
|
245
|
|
246
|
if( cubit < NUM_CORNERS*numCubitsPerCorner + NUM_EDGES*numCubitsPerEdge )
|
247
|
{
|
248
|
int edge = (cubit-NUM_CORNERS*numCubitsPerCorner)/numCubitsPerEdge;
|
249
|
return mQuatEdgeIndices[edge];
|
250
|
}
|
251
|
|
252
|
int center = cubit - NUM_CORNERS*numCubitsPerCorner - NUM_EDGES*numCubitsPerEdge;
|
253
|
return mQuatCenterIndices[center];
|
254
|
}
|
255
|
|
256
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
257
|
|
258
|
public ObjectShape getObjectShape(int variant)
|
259
|
{
|
260
|
int[] numLayers = getNumLayers();
|
261
|
int numVariants = getNumCubitVariants(numLayers);
|
262
|
int numL = numLayers[0];
|
263
|
|
264
|
if( variant==0 )
|
265
|
{
|
266
|
float width = numL*(0.5f-MEGA_D)/(0.5f*(numL-1));
|
267
|
float X = width*COS18*SIN_HALFD;
|
268
|
float Y = width*SIN18;
|
269
|
float Z = width*COS18*COS_HALFD;
|
270
|
|
271
|
float[][] vertices =
|
272
|
{
|
273
|
{ 0, 0 , 0 },
|
274
|
{ X, Y , -Z },
|
275
|
{ 0, 2*Y ,-2*Z },
|
276
|
{ -X, Y , -Z },
|
277
|
{ 0, 0-width, 0 },
|
278
|
{ X, Y-width, -Z },
|
279
|
{ 0, 2*Y-width,-2*Z },
|
280
|
{ -X, Y-width, -Z },
|
281
|
};
|
282
|
|
283
|
int[][] indices =
|
284
|
{
|
285
|
{4,5,1,0},
|
286
|
{7,4,0,3},
|
287
|
{0,1,2,3},
|
288
|
{7,6,5,4},
|
289
|
{2,1,5,6},
|
290
|
{3,2,6,7}
|
291
|
};
|
292
|
|
293
|
return new ObjectShape(vertices, indices);
|
294
|
}
|
295
|
if( variant<numVariants-1 )
|
296
|
{
|
297
|
int type = variant-1;
|
298
|
float height= numL*(0.5f-MEGA_D)*COS18/((numL-1)*0.5f);
|
299
|
float width = numL*2*MEGA_D + 2*type*height*SIN18/COS18;
|
300
|
|
301
|
float W = width/2;
|
302
|
float X = height*SIN_HALFD;
|
303
|
float Y = height*SIN18/COS18;
|
304
|
float Z = height*COS_HALFD;
|
305
|
|
306
|
float[][] vertices =
|
307
|
{
|
308
|
{ 0, W , 0 },
|
309
|
{ X, W+Y , -Z },
|
310
|
{ 0, W+2*Y ,-2*Z },
|
311
|
{ -X, W+Y , -Z },
|
312
|
{ 0, -W , 0 },
|
313
|
{ X,-W-Y , -Z },
|
314
|
{ 0,-W-2*Y ,-2*Z },
|
315
|
{ -X,-W-Y , -Z },
|
316
|
};
|
317
|
|
318
|
int[][] indices =
|
319
|
{
|
320
|
{4,5,1,0},
|
321
|
{7,4,0,3},
|
322
|
{3,2,6,7},
|
323
|
{2,1,5,6},
|
324
|
{0,1,2,3},
|
325
|
{7,6,5,4}
|
326
|
};
|
327
|
|
328
|
return new ObjectShape(vertices, indices);
|
329
|
}
|
330
|
else
|
331
|
{
|
332
|
float width = 2*numL*(MEGA_D+(0.5f-MEGA_D)*SIN18);
|
333
|
final double ANGLE = 0.825f*Math.PI;
|
334
|
final float cosA = (float)Math.cos(ANGLE);
|
335
|
final float sinA = (float)Math.sin(ANGLE);
|
336
|
|
337
|
float R = 0.5f*width/COS54;
|
338
|
float X1 = R*COS54;
|
339
|
float Y1 = R*SIN54;
|
340
|
float X2 = R*COS18;
|
341
|
float Y2 = R*SIN18;
|
342
|
|
343
|
float[][] vertices =
|
344
|
{
|
345
|
{-X1,+Y1*sinA, Y1*cosA},
|
346
|
{-X2,-Y2*sinA,-Y2*cosA},
|
347
|
{ 0 ,-R*sinA ,-R*cosA },
|
348
|
{+X2,-Y2*sinA,-Y2*cosA},
|
349
|
{+X1,+Y1*sinA, Y1*cosA},
|
350
|
{ 0 , R*cosA ,-R*sinA }
|
351
|
};
|
352
|
|
353
|
int[][] indices =
|
354
|
{
|
355
|
{0,1,2,3,4},
|
356
|
{5,1,0},
|
357
|
{5,2,1},
|
358
|
{5,3,2},
|
359
|
{5,4,3},
|
360
|
{5,0,4}
|
361
|
};
|
362
|
|
363
|
return new ObjectShape(vertices, indices);
|
364
|
}
|
365
|
}
|
366
|
|
367
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
368
|
|
369
|
public ObjectFaceShape getObjectFaceShape(int variant)
|
370
|
{
|
371
|
int[] numLayers = getNumLayers();
|
372
|
int numVariants = getNumCubitVariants(numLayers);
|
373
|
int numL = numLayers[0];
|
374
|
boolean small = numL<=3;
|
375
|
|
376
|
if( variant==0 )
|
377
|
{
|
378
|
float A = (2*SQ3/3)*SIN54;
|
379
|
float B = 0.4f;
|
380
|
float h1 = isInIconMode() ? 0.001f : 0.04f;
|
381
|
|
382
|
float[][] bands = { {h1,34,0.3f,0.2f, 3, 0, 0}, {0.001f, 10,0.0f,0.0f, 2, 0, 0} };
|
383
|
int[] bandIndices = { 0,0,0,1,1,1};
|
384
|
float[][] corners = { {0.04f,0.10f} };
|
385
|
int[] cornerIndices = { 0,-1,-1,-1,-1,-1,-1,-1 };
|
386
|
float[][] centers = { {0.0f, -(float)Math.sqrt(1-A*A)*B,-A*B} };
|
387
|
int[] centerIndices = { 0,-1,-1,-1,-1,-1,-1,-1 };
|
388
|
|
389
|
return new ObjectFaceShape(bands,bandIndices,corners,cornerIndices,centers,centerIndices,null);
|
390
|
}
|
391
|
if( variant<numVariants-1 )
|
392
|
{
|
393
|
float height= numL*(0.5f-MEGA_D)*COS18/((numL-1)*0.5f);
|
394
|
float Z = height*COS_HALFD;
|
395
|
int N = small ? 5 : 3;
|
396
|
float h1 = isInIconMode() ? 0.001f : 0.04f;
|
397
|
|
398
|
float[][] bands = { {h1,34,0.2f,0.2f,N,0,0},{0.001f,34,0.3f,0.2f,2,0,0} };
|
399
|
int[] bandIndices = { 0,0,1,1,1,1};
|
400
|
float[][] corners = { {0.04f,0.10f} };
|
401
|
int[] cornerIndices = { -1,-1,-1,-1, -1,-1,-1,-1 };
|
402
|
float[][] centers = { {0.0f, 0.0f, -2*Z} };
|
403
|
int[] centerIndices = { -1,-1,-1,-1, -1,-1,-1,-1 };
|
404
|
|
405
|
return new ObjectFaceShape(bands,bandIndices,corners,cornerIndices,centers,centerIndices,null);
|
406
|
}
|
407
|
else
|
408
|
{
|
409
|
float width = 2*numL*(MEGA_D+(0.5f-MEGA_D)*SIN18);
|
410
|
float R = 0.5f*width/COS54;
|
411
|
int N = small ? 4 : 3;
|
412
|
float h1 = isInIconMode() ? 0.001f : (small ? 0.04f : 0.015f);
|
413
|
|
414
|
float[][] bands = { { h1,45, R/3,0.2f,N,0,0},{0.001f,45, R/3,0.2f,2,0,0} };
|
415
|
int[] bandIndices = { 0,1,1,1,1,1 };
|
416
|
float[][] corners = { {0.04f,0.10f} };
|
417
|
int[] cornerIndices = { -1,-1,-1,-1, -1,-1 };
|
418
|
float[][] centers = { {0.0f, 0.0f, 0.0f} };
|
419
|
int[] centerIndices = { -1,-1,-1,-1, -1,-1 };
|
420
|
|
421
|
return new ObjectFaceShape(bands,bandIndices,corners,cornerIndices,centers,centerIndices,null);
|
422
|
}
|
423
|
}
|
424
|
|
425
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
426
|
|
427
|
public int getNumCubitVariants(int[] numLayers)
|
428
|
{
|
429
|
return 2 + numLayers[0]/2;
|
430
|
}
|
431
|
|
432
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
433
|
|
434
|
public int getCubitVariant(int cubit, int[] numLayers)
|
435
|
{
|
436
|
int numL = numLayers[0];
|
437
|
int numCubitsPerCorner = numCubitsPerCorner(numL);
|
438
|
|
439
|
if( cubit<NUM_CORNERS*numCubitsPerCorner ) return 0;
|
440
|
|
441
|
int numCubitsPerEdge = numCubitsPerEdge(numL);
|
442
|
|
443
|
if( cubit<NUM_CORNERS*numCubitsPerCorner + NUM_EDGES*numCubitsPerEdge )
|
444
|
{
|
445
|
int type = computeEdgeType(cubit,numCubitsPerCorner,numCubitsPerEdge);
|
446
|
return type+1;
|
447
|
}
|
448
|
|
449
|
return getNumCubitVariants(numLayers)-1;
|
450
|
}
|
451
|
|
452
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
453
|
|
454
|
public float getStickerRadius()
|
455
|
{
|
456
|
return 0.13f;
|
457
|
}
|
458
|
|
459
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
460
|
|
461
|
public float getStickerStroke()
|
462
|
{
|
463
|
float stroke = 0.18f;
|
464
|
|
465
|
if( isInIconMode() )
|
466
|
{
|
467
|
int[] numLayers = getNumLayers();
|
468
|
stroke*= ( numLayers[0]==3 ? 1.5f : 2.2f );
|
469
|
}
|
470
|
|
471
|
return stroke;
|
472
|
}
|
473
|
|
474
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
475
|
|
476
|
public float[][] getStickerAngles()
|
477
|
{
|
478
|
return null;
|
479
|
}
|
480
|
|
481
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
482
|
|
483
|
public String getShortName()
|
484
|
{
|
485
|
switch(getNumLayers()[0])
|
486
|
{
|
487
|
case 3: return ObjectType.MEGA_3.name();
|
488
|
case 5: return ObjectType.MEGA_5.name();
|
489
|
}
|
490
|
|
491
|
return ObjectType.MEGA_3.name();
|
492
|
}
|
493
|
|
494
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
495
|
|
496
|
public ObjectSignature getSignature()
|
497
|
{
|
498
|
switch(getNumLayers()[0])
|
499
|
{
|
500
|
case 3: return new ObjectSignature(ObjectType.MEGA_3);
|
501
|
case 5: return new ObjectSignature(ObjectType.MEGA_5);
|
502
|
}
|
503
|
|
504
|
return null;
|
505
|
}
|
506
|
|
507
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
508
|
|
509
|
public String getObjectName()
|
510
|
{
|
511
|
switch(getNumLayers()[0])
|
512
|
{
|
513
|
case 3: return "Megaminx";
|
514
|
case 5: return "Gigaminx";
|
515
|
}
|
516
|
return "Megaminx";
|
517
|
}
|
518
|
|
519
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
520
|
|
521
|
public String getInventor()
|
522
|
{
|
523
|
switch(getNumLayers()[0])
|
524
|
{
|
525
|
case 3: return "Ferenc Szlivka";
|
526
|
case 5: return "Tyler Fox";
|
527
|
}
|
528
|
return "Ferenc Szlivka";
|
529
|
}
|
530
|
|
531
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
532
|
|
533
|
public int getYearOfInvention()
|
534
|
{
|
535
|
switch(getNumLayers()[0])
|
536
|
{
|
537
|
case 3: return 1982;
|
538
|
case 5: return 2006;
|
539
|
}
|
540
|
return 2006;
|
541
|
}
|
542
|
|
543
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
544
|
|
545
|
public int getComplexity()
|
546
|
{
|
547
|
switch(getNumLayers()[0])
|
548
|
{
|
549
|
case 3: return 3;
|
550
|
case 5: return 4;
|
551
|
}
|
552
|
return 9;
|
553
|
}
|
554
|
|
555
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
556
|
|
557
|
public String[][] getTutorials()
|
558
|
{
|
559
|
int[] numLayers = getNumLayers();
|
560
|
|
561
|
switch(numLayers[0])
|
562
|
{
|
563
|
case 3: return new String[][] {
|
564
|
{"gb","j4x61L5Onzk","How to Solve the Megaminx","Z3"},
|
565
|
{"es","xuKbT6Il0Ko","Resolver Megaminx","Cuby"},
|
566
|
{"ru","WgoguOY3tKI","Как собрать Мегаминкс","Алексей Ярыгин"},
|
567
|
{"fr","Ln1vl85puKo","Résoudre le Megaminx","Victor Colin"},
|
568
|
{"de","d-GQD6CBdB8","Megaminx lösen","Pezcraft"},
|
569
|
{"pl","BZTW6ApeRZE","Jak ułożyć: Megaminx","DżoDżo"},
|
570
|
{"br","0BTzkDZW078","Como resolver o Megaminx 1/2","Pedro Filho"},
|
571
|
{"br","VVHzZI73BN0","Como resolver o Megaminx 2/2","Pedro Filho"},
|
572
|
{"kr","2NUsMclrD-0","메가밍크스 예시솔빙","iamzoone"},
|
573
|
{"vn","wRN3t91vD8w","Tutorial N.9 - Megaminx","Duy Thích Rubik"},
|
574
|
};
|
575
|
case 5: return new String[][] {
|
576
|
{"gb","MNBMm8BnHtQ","Solve the Gigaminx Part 1","BeardedCubing"},
|
577
|
{"gb","QrrP4GwqVMw","Solve the Gigaminx Part 2","BeardedCubing"},
|
578
|
{"es","ex5EQMBxV1U","Tutorial Gigaminx","RubikArt"},
|
579
|
{"ru","UJYK3SHjSGg","Как собрать Гигаминкс ч.1","Артем Мартиросов"},
|
580
|
{"ru","-iBCpr4Gwsw","Как собрать Гигаминкс ч.2","Артем Мартиросов"},
|
581
|
{"ru","4-dI7NCW8n8","Как собрать Гигаминкс ч.3","Артем Мартиросов"},
|
582
|
{"fr","e485fh0V1dg","Résolution du Gigaminx","Asthalis"},
|
583
|
{"de","APSAj4UtOAg","Megaminx 5x5 lösen","JamesKnopf"},
|
584
|
{"pl","qbKLMCX1wKg","Jak ułożyć Gigaminxa cz.1","chomik19751"},
|
585
|
{"pl","JQOXD3qleH4","Jak ułożyć Gigaminxa cz.2","chomik19751"},
|
586
|
{"pl","WF2katJ22FA","Jak ułożyć Gigaminxa cz.3","chomik19751"},
|
587
|
{"pl","jlyRrJjH4qQ","Jak ułożyć Gigaminxa cz.4","chomik19751"},
|
588
|
{"kr","HfPFrWuz6z4","기가밍크스 gigaminx","큐브놀이터"},
|
589
|
{"vn","yJzejHqZscY","Tutorial N.49 - Gigaminx","Duy Thích Rubik"},
|
590
|
};
|
591
|
}
|
592
|
return null;
|
593
|
}
|
594
|
}
|