1 |
29b82486
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2 |
|
|
// Copyright 2019 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 |
0c5d8bf7
|
Leszek Koltunski
|
import static org.distorted.objectlib.touchcontrol.TouchControl.TC_CHANGING_MIRROR;
|
23 |
c9c71c3f
|
Leszek Koltunski
|
import static org.distorted.objectlib.touchcontrol.TouchControl.TYPE_NOT_SPLIT;
|
24 |
29b82486
|
Leszek Koltunski
|
|
25 |
82eb152a
|
Leszek Koltunski
|
import java.io.InputStream;
|
26 |
29b82486
|
Leszek Koltunski
|
|
27 |
|
|
import org.distorted.library.type.Static3D;
|
28 |
|
|
import org.distorted.library.type.Static4D;
|
29 |
|
|
|
30 |
3ee1d662
|
Leszek Koltunski
|
import org.distorted.objectlib.helpers.ObjectFaceShape;
|
31 |
1d581993
|
Leszek Koltunski
|
import org.distorted.objectlib.helpers.ObjectSignature;
|
32 |
8005e762
|
Leszek Koltunski
|
import org.distorted.objectlib.main.ObjectType;
|
33 |
198c5bf0
|
Leszek Koltunski
|
import org.distorted.objectlib.helpers.ObjectShape;
|
34 |
10b7e306
|
Leszek Koltunski
|
import org.distorted.objectlib.scrambling.ScrambleState;
|
35 |
386af988
|
Leszek Koltunski
|
import org.distorted.objectlib.main.ShapeHexahedron;
|
36 |
4c9ca251
|
Leszek Koltunski
|
import org.distorted.objectlib.touchcontrol.TouchControlHexahedron;
|
37 |
29b82486
|
Leszek Koltunski
|
|
38 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
39 |
|
|
|
40 |
386af988
|
Leszek Koltunski
|
public class TwistyMirror extends ShapeHexahedron
|
41 |
29b82486
|
Leszek Koltunski
|
{
|
42 |
|
|
static final Static3D[] ROT_AXIS = new Static3D[]
|
43 |
|
|
{
|
44 |
|
|
new Static3D(1,0,0),
|
45 |
|
|
new Static3D(0,1,0),
|
46 |
|
|
new Static3D(0,0,1)
|
47 |
|
|
};
|
48 |
|
|
|
49 |
|
|
private static final int[] FACE_COLORS = new int[] { COLOR_WHITE };
|
50 |
|
|
private static final float DX = 0.10f;
|
51 |
|
|
private static final float DY = 0.25f;
|
52 |
|
|
private static final float DZ = 0.40f;
|
53 |
|
|
|
54 |
|
|
private ScrambleState[] mStates;
|
55 |
|
|
private float[][] mCuts;
|
56 |
beee90ab
|
Leszek Koltunski
|
private int[][] mBasicAngle;
|
57 |
29b82486
|
Leszek Koltunski
|
private float[][] mPositions;
|
58 |
|
|
|
59 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
60 |
|
|
|
61 |
3bf19410
|
Leszek Koltunski
|
public TwistyMirror(int[] numL, int meshState, int iconMode, Static4D quat, Static3D move, float scale, InputStream stream)
|
62 |
29b82486
|
Leszek Koltunski
|
{
|
63 |
3bf19410
|
Leszek Koltunski
|
super(numL, meshState, iconMode, numL[0], quat, move, scale, stream);
|
64 |
29b82486
|
Leszek Koltunski
|
}
|
65 |
|
|
|
66 |
253e440f
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
67 |
|
|
|
68 |
|
|
@Override
|
69 |
|
|
public int getInternalColor()
|
70 |
|
|
{
|
71 |
|
|
return 0xff333333;
|
72 |
|
|
}
|
73 |
|
|
|
74 |
ed0988c0
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
75 |
|
|
|
76 |
|
|
@Override
|
77 |
|
|
public int getColor(int face)
|
78 |
|
|
{
|
79 |
|
|
return FACE_COLORS[face];
|
80 |
|
|
}
|
81 |
|
|
|
82 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
83 |
|
|
|
84 |
|
|
@Override
|
85 |
|
|
public int getNumFaceColors()
|
86 |
|
|
{
|
87 |
|
|
return 1;
|
88 |
|
|
}
|
89 |
|
|
|
90 |
29b82486
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
91 |
|
|
|
92 |
f9a81f52
|
Leszek Koltunski
|
public ScrambleState[] getScrambleStates()
|
93 |
29b82486
|
Leszek Koltunski
|
{
|
94 |
|
|
if( mStates==null )
|
95 |
|
|
{
|
96 |
a57e6870
|
Leszek Koltunski
|
int[] numLayers = getNumLayers();
|
97 |
29b82486
|
Leszek Koltunski
|
int[][] m = new int[16][];
|
98 |
a57e6870
|
Leszek Koltunski
|
for(int i=1; i<16; i++) m[i] = createEdges(numLayers[0],i);
|
99 |
29b82486
|
Leszek Koltunski
|
|
100 |
|
|
mStates = new ScrambleState[]
|
101 |
|
|
{
|
102 |
|
|
new ScrambleState( new int[][] { m[ 1], m[ 2], m[ 3] } ), // 0
|
103 |
|
|
new ScrambleState( new int[][] { null, m[ 4], m[ 5] } ), // x
|
104 |
|
|
new ScrambleState( new int[][] { m[ 6], null, m[ 7] } ), // y
|
105 |
|
|
new ScrambleState( new int[][] { m[ 8], m[ 8], null } ), // z
|
106 |
|
|
new ScrambleState( new int[][] { m[10], null, m[ 7] } ), // xy
|
107 |
|
|
new ScrambleState( new int[][] { m[11], m[ 9], null } ), // xz
|
108 |
|
|
new ScrambleState( new int[][] { null, m[12], m[ 5] } ), // yx
|
109 |
|
|
new ScrambleState( new int[][] { m[ 8], m[13], null } ), // yz
|
110 |
|
|
new ScrambleState( new int[][] { null, m[ 4], m[14] } ), // zx
|
111 |
|
|
new ScrambleState( new int[][] { m[ 6], null, m[15] } ), // zy
|
112 |
|
|
new ScrambleState( new int[][] { null, null, m[ 5] } ), // xyx
|
113 |
|
|
new ScrambleState( new int[][] { null, m[ 4], null } ), // xzx
|
114 |
|
|
new ScrambleState( new int[][] { null, null, m[ 7] } ), // yxy
|
115 |
|
|
new ScrambleState( new int[][] { m[ 6], null, null } ), // yzy
|
116 |
|
|
new ScrambleState( new int[][] { null, m[ 9], null } ), // zxz
|
117 |
|
|
new ScrambleState( new int[][] { m[ 8], null, null } ), // zyz
|
118 |
|
|
};
|
119 |
|
|
}
|
120 |
|
|
|
121 |
|
|
return mStates;
|
122 |
|
|
}
|
123 |
|
|
|
124 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
125 |
|
|
|
126 |
|
|
private int[] createEdges(int size, int vertex)
|
127 |
|
|
{
|
128 |
|
|
int[] ret = new int[9*size];
|
129 |
|
|
|
130 |
|
|
for(int l=0; l<size; l++)
|
131 |
|
|
{
|
132 |
|
|
ret[9*l ] = l;
|
133 |
|
|
ret[9*l+1] =-1;
|
134 |
|
|
ret[9*l+2] = vertex;
|
135 |
|
|
ret[9*l+3] = l;
|
136 |
|
|
ret[9*l+4] = 1;
|
137 |
|
|
ret[9*l+5] = vertex;
|
138 |
|
|
ret[9*l+6] = l;
|
139 |
|
|
ret[9*l+7] = 2;
|
140 |
|
|
ret[9*l+8] = vertex;
|
141 |
|
|
}
|
142 |
|
|
|
143 |
|
|
return ret;
|
144 |
|
|
}
|
145 |
|
|
|
146 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
147 |
|
|
|
148 |
|
|
private int getRow(int cubit, int numLayers, int dim)
|
149 |
|
|
{
|
150 |
|
|
return (int)(mPositions[cubit][dim] + 0.5f*(numLayers-1));
|
151 |
|
|
}
|
152 |
|
|
|
153 |
d0e6cf7f
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
154 |
|
|
|
155 |
|
|
public float[][] getCubitPositions(int[] numLayers)
|
156 |
|
|
{
|
157 |
|
|
if( mPositions==null )
|
158 |
|
|
{
|
159 |
|
|
int numL = numLayers[0];
|
160 |
05cb5de6
|
Leszek Koltunski
|
int numCubits = getNumCubitVariants(numLayers);
|
161 |
d0e6cf7f
|
Leszek Koltunski
|
mPositions = new float[numCubits][];
|
162 |
|
|
|
163 |
|
|
float diff = 0.5f*(numL-1);
|
164 |
|
|
int currentPosition = 0;
|
165 |
|
|
|
166 |
|
|
for(int x = 0; x<numL; x++)
|
167 |
|
|
for(int y = 0; y<numL; y++)
|
168 |
|
|
for(int z = 0; z<numL; z++)
|
169 |
|
|
if( x==0 || x==numL-1 || y==0 || y==numL-1 || z==0 || z==numL-1 )
|
170 |
|
|
{
|
171 |
|
|
mPositions[currentPosition++] = new float[] {x-diff,y-diff,z-diff};
|
172 |
|
|
}
|
173 |
|
|
}
|
174 |
|
|
|
175 |
|
|
return mPositions;
|
176 |
|
|
}
|
177 |
|
|
|
178 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
179 |
|
|
|
180 |
|
|
public Static4D getCubitQuats(int cubit, int[] numLayers)
|
181 |
|
|
{
|
182 |
1597769c
|
Leszek Koltunski
|
return mObjectQuats[0];
|
183 |
d0e6cf7f
|
Leszek Koltunski
|
}
|
184 |
|
|
|
185 |
29b82486
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
186 |
|
|
|
187 |
e30c522a
|
Leszek Koltunski
|
public ObjectShape getObjectShape(int variant)
|
188 |
29b82486
|
Leszek Koltunski
|
{
|
189 |
3ee1d662
|
Leszek Koltunski
|
int numL = getNumLayers()[0];
|
190 |
e30c522a
|
Leszek Koltunski
|
int xrow = getRow(variant,numL,0); // cubit == variant
|
191 |
|
|
int yrow = getRow(variant,numL,1);
|
192 |
|
|
int zrow = getRow(variant,numL,2);
|
193 |
29b82486
|
Leszek Koltunski
|
|
194 |
a57e6870
|
Leszek Koltunski
|
float XL = -0.5f + (xrow== 0 ? DX : 0);
|
195 |
|
|
float XR = +0.5f + (xrow==numL-1 ? DX : 0);
|
196 |
|
|
float YL = -0.5f - (yrow== 0 ? DY : 0);
|
197 |
|
|
float YR = +0.5f - (yrow==numL-1 ? DY : 0);
|
198 |
|
|
float ZL = -0.5f - (zrow== 0 ? DZ : 0);
|
199 |
|
|
float ZR = +0.5f - (zrow==numL-1 ? DZ : 0);
|
200 |
29b82486
|
Leszek Koltunski
|
|
201 |
4e9f2df5
|
Leszek Koltunski
|
float[][] vertices =
|
202 |
29b82486
|
Leszek Koltunski
|
{
|
203 |
|
|
{ XR, YR, ZR },
|
204 |
|
|
{ XR, YR, ZL },
|
205 |
|
|
{ XR, YL, ZR },
|
206 |
|
|
{ XR, YL, ZL },
|
207 |
|
|
{ XL, YR, ZR },
|
208 |
|
|
{ XL, YR, ZL },
|
209 |
|
|
{ XL, YL, ZR },
|
210 |
|
|
{ XL, YL, ZL },
|
211 |
|
|
};
|
212 |
|
|
|
213 |
4e9f2df5
|
Leszek Koltunski
|
int[][] indices =
|
214 |
29b82486
|
Leszek Koltunski
|
{
|
215 |
|
|
{2,3,1,0},
|
216 |
|
|
{7,6,4,5},
|
217 |
|
|
{4,0,1,5},
|
218 |
|
|
{7,3,2,6},
|
219 |
|
|
{6,2,0,4},
|
220 |
|
|
{3,7,5,1}
|
221 |
|
|
};
|
222 |
|
|
|
223 |
59a971c1
|
Leszek Koltunski
|
return new ObjectShape(vertices, indices);
|
224 |
3ee1d662
|
Leszek Koltunski
|
}
|
225 |
|
|
|
226 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
227 |
|
|
|
228 |
|
|
public ObjectFaceShape getObjectFaceShape(int variant)
|
229 |
|
|
{
|
230 |
|
|
int extraI, extraV, num, numL = getNumLayers()[0];
|
231 |
3bf19410
|
Leszek Koltunski
|
float height = isInIconMode() ? 0.001f : 0.045f;
|
232 |
3ee1d662
|
Leszek Koltunski
|
|
233 |
|
|
switch(numL)
|
234 |
|
|
{
|
235 |
3bf19410
|
Leszek Koltunski
|
case 2 : num = 6; extraI = 2; extraV = 2; break;
|
236 |
|
|
case 3 : num = 5; extraI = 2; extraV = 2; break;
|
237 |
|
|
case 4 : num = 5; extraI = 0; extraV = 0; break;
|
238 |
|
|
default: num = 4; extraI = 0; extraV = 0; break;
|
239 |
3ee1d662
|
Leszek Koltunski
|
}
|
240 |
|
|
|
241 |
|
|
float[][] bands = { {height,35,0.5f,0.7f,num,extraI,extraV} };
|
242 |
4c9ca251
|
Leszek Koltunski
|
int[] bandIndices = { 0,0,0,0,0,0 };
|
243 |
3ee1d662
|
Leszek Koltunski
|
float[][] corners = { {0.036f,0.12f} };
|
244 |
|
|
int[] cornerIndices = { 0,0,0,0,0,0,0,0 };
|
245 |
|
|
float[][] centers = { {0.0f, 0.0f, 0.0f} };
|
246 |
|
|
int[] centerIndices = { 0,0,0,0,0,0,0,0 };
|
247 |
29b82486
|
Leszek Koltunski
|
|
248 |
3ee1d662
|
Leszek Koltunski
|
return new ObjectFaceShape(bands,bandIndices,corners,cornerIndices,centers,centerIndices,null);
|
249 |
29b82486
|
Leszek Koltunski
|
}
|
250 |
|
|
|
251 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
252 |
|
|
|
253 |
e30c522a
|
Leszek Koltunski
|
public int getNumCubitVariants(int[] numLayers)
|
254 |
29b82486
|
Leszek Koltunski
|
{
|
255 |
a57e6870
|
Leszek Koltunski
|
int numL = numLayers[0];
|
256 |
05cb5de6
|
Leszek Koltunski
|
return numL>1 ? 6*numL*numL - 12*numL + 8 : 1;
|
257 |
29b82486
|
Leszek Koltunski
|
}
|
258 |
|
|
|
259 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
260 |
|
|
|
261 |
e30c522a
|
Leszek Koltunski
|
public int getCubitVariant(int cubit, int[] numLayers)
|
262 |
29b82486
|
Leszek Koltunski
|
{
|
263 |
|
|
return cubit;
|
264 |
|
|
}
|
265 |
|
|
|
266 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
267 |
|
|
|
268 |
7bbfc84f
|
Leszek Koltunski
|
public float[][] getCuts(int[] numLayers)
|
269 |
29b82486
|
Leszek Koltunski
|
{
|
270 |
|
|
if( mCuts==null )
|
271 |
|
|
{
|
272 |
a57e6870
|
Leszek Koltunski
|
int numL = numLayers[0];
|
273 |
|
|
mCuts = new float[3][numL-1];
|
274 |
29b82486
|
Leszek Koltunski
|
|
275 |
a57e6870
|
Leszek Koltunski
|
for(int i=0; i<numL-1; i++)
|
276 |
29b82486
|
Leszek Koltunski
|
{
|
277 |
a57e6870
|
Leszek Koltunski
|
float cut = (2-numL)*0.5f + i;
|
278 |
29b82486
|
Leszek Koltunski
|
mCuts[0][i] = cut;
|
279 |
|
|
mCuts[1][i] = cut;
|
280 |
|
|
mCuts[2][i] = cut;
|
281 |
|
|
}
|
282 |
|
|
}
|
283 |
|
|
|
284 |
|
|
return mCuts;
|
285 |
|
|
}
|
286 |
|
|
|
287 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
288 |
|
|
|
289 |
59c20632
|
Leszek Koltunski
|
public boolean[][] getLayerRotatable(int[] numLayers)
|
290 |
29b82486
|
Leszek Koltunski
|
{
|
291 |
05cb5de6
|
Leszek Koltunski
|
int num = numLayers[0];
|
292 |
|
|
boolean[] tmp = new boolean[num];
|
293 |
|
|
for(int i=0; i<num; i++) tmp[i] = true;
|
294 |
|
|
return new boolean[][] { tmp,tmp,tmp };
|
295 |
29b82486
|
Leszek Koltunski
|
}
|
296 |
|
|
|
297 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
298 |
|
|
|
299 |
11fa413d
|
Leszek Koltunski
|
public int getTouchControlType()
|
300 |
59c20632
|
Leszek Koltunski
|
{
|
301 |
0c5d8bf7
|
Leszek Koltunski
|
return TC_CHANGING_MIRROR;
|
302 |
59c20632
|
Leszek Koltunski
|
}
|
303 |
|
|
|
304 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
305 |
|
|
|
306 |
11fa413d
|
Leszek Koltunski
|
public int getTouchControlSplit()
|
307 |
59c20632
|
Leszek Koltunski
|
{
|
308 |
|
|
return TYPE_NOT_SPLIT;
|
309 |
|
|
}
|
310 |
|
|
|
311 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
312 |
|
|
|
313 |
|
|
public int[][][] getEnabled()
|
314 |
|
|
{
|
315 |
82904e62
|
Leszek Koltunski
|
return null;
|
316 |
59c20632
|
Leszek Koltunski
|
}
|
317 |
|
|
|
318 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
319 |
|
|
|
320 |
|
|
public float[] getDist3D(int[] numLayers)
|
321 |
|
|
{
|
322 |
4c9ca251
|
Leszek Koltunski
|
int N = numLayers[0];
|
323 |
|
|
return new float[] { 0.5f+DX/N, 0.5f-DX/N, 0.5f-DY/N, 0.5f+DY/N, 0.5f-DZ/N, 0.5f+DZ/N };
|
324 |
|
|
}
|
325 |
|
|
|
326 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
327 |
|
|
|
328 |
|
|
public Static3D[] getFaceAxis()
|
329 |
|
|
{
|
330 |
|
|
return TouchControlHexahedron.FACE_AXIS;
|
331 |
59c20632
|
Leszek Koltunski
|
}
|
332 |
|
|
|
333 |
b0720f49
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
334 |
|
|
|
335 |
d53fb890
|
Leszek Koltunski
|
public float getStickerRadius()
|
336 |
b0720f49
|
Leszek Koltunski
|
{
|
337 |
|
|
return 0.10f;
|
338 |
|
|
}
|
339 |
|
|
|
340 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
341 |
|
|
|
342 |
d53fb890
|
Leszek Koltunski
|
public float getStickerStroke()
|
343 |
b0720f49
|
Leszek Koltunski
|
{
|
344 |
|
|
float stroke = 0.08f;
|
345 |
|
|
|
346 |
3bf19410
|
Leszek Koltunski
|
if( isInIconMode() )
|
347 |
b0720f49
|
Leszek Koltunski
|
{
|
348 |
|
|
int[] numLayers = getNumLayers();
|
349 |
|
|
stroke*= ( numLayers[0]==2 ? 1.8f : 2.0f );
|
350 |
|
|
}
|
351 |
|
|
|
352 |
|
|
return stroke;
|
353 |
|
|
}
|
354 |
|
|
|
355 |
00f4980d
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
356 |
|
|
|
357 |
d53fb890
|
Leszek Koltunski
|
public float[][] getStickerAngles()
|
358 |
00f4980d
|
Leszek Koltunski
|
{
|
359 |
|
|
return null;
|
360 |
|
|
}
|
361 |
|
|
|
362 |
29b82486
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
363 |
|
|
// PUBLIC API
|
364 |
|
|
|
365 |
|
|
public Static3D[] getRotationAxis()
|
366 |
|
|
{
|
367 |
|
|
return ROT_AXIS;
|
368 |
|
|
}
|
369 |
|
|
|
370 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
371 |
|
|
|
372 |
beee90ab
|
Leszek Koltunski
|
public int[][] getBasicAngles()
|
373 |
29b82486
|
Leszek Koltunski
|
{
|
374 |
beee90ab
|
Leszek Koltunski
|
if( mBasicAngle==null )
|
375 |
|
|
{
|
376 |
|
|
int num = getNumLayers()[0];
|
377 |
|
|
int[] tmp = new int[num];
|
378 |
|
|
for(int i=0; i<num; i++) tmp[i] = 4;
|
379 |
|
|
mBasicAngle = new int[][] { tmp,tmp,tmp };
|
380 |
|
|
}
|
381 |
|
|
|
382 |
29b82486
|
Leszek Koltunski
|
return mBasicAngle;
|
383 |
|
|
}
|
384 |
|
|
|
385 |
61aa85e4
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
386 |
|
|
|
387 |
5f54927b
|
Leszek Koltunski
|
public String getShortName()
|
388 |
61aa85e4
|
Leszek Koltunski
|
{
|
389 |
5f54927b
|
Leszek Koltunski
|
switch(getNumLayers()[0])
|
390 |
|
|
{
|
391 |
|
|
case 2: return ObjectType.MIRR_2.name();
|
392 |
|
|
case 3: return ObjectType.MIRR_3.name();
|
393 |
|
|
case 4: return ObjectType.MIRR_4.name();
|
394 |
|
|
}
|
395 |
|
|
|
396 |
|
|
return ObjectType.MIRR_2.name();
|
397 |
|
|
}
|
398 |
|
|
|
399 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
400 |
|
|
|
401 |
1d581993
|
Leszek Koltunski
|
public ObjectSignature getSignature()
|
402 |
5f54927b
|
Leszek Koltunski
|
{
|
403 |
|
|
switch(getNumLayers()[0])
|
404 |
61aa85e4
|
Leszek Koltunski
|
{
|
405 |
1d581993
|
Leszek Koltunski
|
case 2: return new ObjectSignature(ObjectType.MIRR_2);
|
406 |
|
|
case 3: return new ObjectSignature(ObjectType.MIRR_3);
|
407 |
|
|
case 4: return new ObjectSignature(ObjectType.MIRR_4);
|
408 |
61aa85e4
|
Leszek Koltunski
|
}
|
409 |
|
|
|
410 |
1d581993
|
Leszek Koltunski
|
return null;
|
411 |
61aa85e4
|
Leszek Koltunski
|
}
|
412 |
|
|
|
413 |
29b82486
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
414 |
|
|
|
415 |
e26eb4e7
|
Leszek Koltunski
|
public String getObjectName()
|
416 |
29b82486
|
Leszek Koltunski
|
{
|
417 |
e26eb4e7
|
Leszek Koltunski
|
switch(getNumLayers()[0])
|
418 |
29b82486
|
Leszek Koltunski
|
{
|
419 |
e26eb4e7
|
Leszek Koltunski
|
case 2: return "Pocket Mirror";
|
420 |
|
|
case 3: return "Mirror Cube";
|
421 |
05cb5de6
|
Leszek Koltunski
|
case 4: return "Master Mirror Blocks";
|
422 |
29b82486
|
Leszek Koltunski
|
}
|
423 |
1d581993
|
Leszek Koltunski
|
return null;
|
424 |
29b82486
|
Leszek Koltunski
|
}
|
425 |
|
|
|
426 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
427 |
|
|
|
428 |
e26eb4e7
|
Leszek Koltunski
|
public String getInventor()
|
429 |
29b82486
|
Leszek Koltunski
|
{
|
430 |
e26eb4e7
|
Leszek Koltunski
|
switch(getNumLayers()[0])
|
431 |
29b82486
|
Leszek Koltunski
|
{
|
432 |
e26eb4e7
|
Leszek Koltunski
|
case 2: return "Thomas de Bruin";
|
433 |
|
|
case 3: return "Hidetoshi Takeji";
|
434 |
05cb5de6
|
Leszek Koltunski
|
case 4: return "Traiphum Prungtaengkit";
|
435 |
29b82486
|
Leszek Koltunski
|
}
|
436 |
1d581993
|
Leszek Koltunski
|
return null;
|
437 |
29b82486
|
Leszek Koltunski
|
}
|
438 |
|
|
|
439 |
59c20632
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
440 |
|
|
|
441 |
e26eb4e7
|
Leszek Koltunski
|
public int getYearOfInvention()
|
442 |
59c20632
|
Leszek Koltunski
|
{
|
443 |
e26eb4e7
|
Leszek Koltunski
|
switch(getNumLayers()[0])
|
444 |
59c20632
|
Leszek Koltunski
|
{
|
445 |
|
|
case 2: return 2007;
|
446 |
|
|
case 3: return 2006;
|
447 |
05cb5de6
|
Leszek Koltunski
|
case 4: return 2014;
|
448 |
59c20632
|
Leszek Koltunski
|
}
|
449 |
|
|
return 2006;
|
450 |
|
|
}
|
451 |
|
|
|
452 |
29b82486
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
453 |
|
|
|
454 |
e26eb4e7
|
Leszek Koltunski
|
public int getComplexity()
|
455 |
29b82486
|
Leszek Koltunski
|
{
|
456 |
e26eb4e7
|
Leszek Koltunski
|
switch(getNumLayers()[0])
|
457 |
29b82486
|
Leszek Koltunski
|
{
|
458 |
b4223a92
|
Leszek Koltunski
|
case 2: return 1;
|
459 |
|
|
case 3: return 2;
|
460 |
05cb5de6
|
Leszek Koltunski
|
case 4: return 3;
|
461 |
29b82486
|
Leszek Koltunski
|
}
|
462 |
05cb5de6
|
Leszek Koltunski
|
return 2;
|
463 |
29b82486
|
Leszek Koltunski
|
}
|
464 |
052e0362
|
Leszek Koltunski
|
|
465 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
466 |
|
|
|
467 |
|
|
public String[][] getTutorials()
|
468 |
|
|
{
|
469 |
|
|
int[] numLayers = getNumLayers();
|
470 |
|
|
|
471 |
|
|
switch(numLayers[0])
|
472 |
|
|
{
|
473 |
|
|
case 2: return new String[][] {
|
474 |
|
|
{"gb","rSH-ZEqTmxs","Solve 2x2 Mirror Blocks","King of Cubing"},
|
475 |
|
|
{"es","Ipz-Ajpd4Fg","Como resolver el mirror 2x2","RUBI CUBI"},
|
476 |
|
|
{"ru","rGqZq0bjZlM","Как собрать Зеркальный кубик 2x2","maggam1000"},
|
477 |
|
|
{"de","fFMf1G7MYmA","2x2 Mirror Cube Anfängerlösung","rofrisch"},
|
478 |
|
|
{"pl","C6B_ZT6xilw","Jak ułożyć kostkę mirror 2x2","Lisek Smolisek"},
|
479 |
|
|
{"kr","9S4QTkyNm4Y","2x2 Mirror Cube","큐브놀이터"},
|
480 |
a399e91b
|
Leszek Koltunski
|
{"vn","6zENEJlv5gA","Hướng Dẫn Giải Mirror 2x2","Rubik Cube"},
|
481 |
052e0362
|
Leszek Koltunski
|
};
|
482 |
|
|
case 3: return new String[][] {
|
483 |
|
|
{"gb","YkzXIWnqbSw","How to Solve the Mirror Cube","Z3"},
|
484 |
|
|
{"es","ZTkunMo51l0","Resolver cubo de Rubik MIRROR","Cuby"},
|
485 |
|
|
{"ru","1QPAD3Q4r78","Как собрать Зеркальный Куб","Алексей Ярыгин"},
|
486 |
|
|
{"fr","tlFLE2UvjFo","Tutoriel: le rubik's cube mirroir","Le Cubiste"},
|
487 |
|
|
{"de","Qf2EadLLiZo","Mirror Cube lösen","Pezcraft"},
|
488 |
|
|
{"pl","r1-MzAL3TxE","Jak ułożyć kostkę mirror","Cube Masters"},
|
489 |
|
|
{"br","HWGGpIKRT_I","Como resolver o Mirror Blocks","Pedro Filho"},
|
490 |
|
|
{"kr","p3OJSbWopqg","미러블럭 해법","듀나메스 큐브 해법연구소"},
|
491 |
a399e91b
|
Leszek Koltunski
|
{"vn","F3Gh6JxW1VI","Tutorial N.15 - Mirror Block","Duy Thích Rubik"},
|
492 |
052e0362
|
Leszek Koltunski
|
};
|
493 |
|
|
case 4: return new String[][] {
|
494 |
|
|
{"gb","6gyQ5qBK8GU","4x4 Mirror: Introduction","SuperAntoniovivaldi"},
|
495 |
|
|
{"gb","jvKLW7vxKx4","4x4 Mirror: Layer by Layer","SuperAntoniovivaldi"},
|
496 |
|
|
{"gb","efHeHrXFNTQ","4x4 Mirror: Reduction","SuperAntoniovivaldi"},
|
497 |
|
|
{"gb","bKHQn_ARNZ8","4x4 Mirror: Parity Free Solve","SuperAntoniovivaldi"},
|
498 |
|
|
{"gb","Us1Dlr0PyEA","4x4 Mirror: Superparity","SuperAntoniovivaldi"},
|
499 |
|
|
{"es","tN2D3j0o-wk","Como hacer un mirror 4x4x4","JGOM Designer"},
|
500 |
a399e91b
|
Leszek Koltunski
|
{"vn","ZGkVOQ3FCOg","Tutorial N.137 - Mirror 4x4x4","Duy Thích Rubik"},
|
501 |
052e0362
|
Leszek Koltunski
|
};
|
502 |
|
|
}
|
503 |
|
|
return null;
|
504 |
|
|
}
|
505 |
29b82486
|
Leszek Koltunski
|
}
|