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