Project

General

Profile

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

magiccube / src / main / java / org / distorted / tutorial / TutorialList.java @ ab656b60

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

    
22
import org.distorted.objects.ObjectList;
23

    
24
///////////////////////////////////////////////////////////////////////////////////////////////////
25

    
26
public enum TutorialList
27
{
28
  CUBE2 ( ObjectList.CUBE, 2,
29
          new String[][] {
30
                          {"gb","rJlh5p2wAKA","How to Solve a 2x2 Rubik's Cube","Z3"},
31
                          {"es","f85wqJTIDlw","Resolver cubo de Rubik 2X2","Cuby"},
32
                          {"ru","azC6P3VYFkc","Как собрать кубик 2Х2","Е Бондаренко"},
33
                          {"fr","V1XS993AUuw","Résoudre le cube 2x2","Rachma Nikov"},
34
                          {"pl","haNWdAYWGsY","Jak ułożyć kostkę Rubika 2x2","DżoDżo"},
35
                       //   {"tw","CfOCXxhCb8U","2x2魔術方塊復原","1hrBLD"},
36
                         }
37
        ),
38

    
39
  CUBE3 ( ObjectList.CUBE, 3,
40
          new String[][] {
41
                          {"gb","-8ohoCKN0Zw","How to Solve a Rubik's Cube","Z3"},
42
                          {"es","GyY0OxDk5lI","Resolver cubo de Rubik 3x3","Cuby"},
43
                          {"ru","5S2eq81FRzI","Как собрать кубик рубика","Е Бондаренко"},
44
                          {"fr","T-ASx2wbHVY","Comment résoudre un Rubik's Cube","Le Cube"},
45
                          {"pl","cBU9Y729nQM","Jak ułożyć kostkę Rubika 3x3","DżoDżo"},
46
                       //   {"tw","76NmRQx5CLA","魔術方塊教學","1hrBLD"},
47
                         }
48
        ),
49

    
50
  CUBE4 ( ObjectList.CUBE, 4,
51
          new String[][] {
52
                          {"gb","RR77Md71Ymc","How to Solve the 4x4 Rubik's Cube","Z3"},
53
                          {"es","d_4xk1r9hxU","Resolver cubo de Rubik 4x4","Cuby"},
54
                          {"ru","v5ytiOyTFSA","Как собрать кубик 4х4","Алексей Ярыгин"},
55
                          {"fr","C83gYXn-zpI","Comment résoudre un Rubik's Cube 4x4","Le Cube"},
56
                          {"pl","LiUxNsowXiI","Jak ułożyć kostkę 4x4","DżoDżo"},
57
                      //    {"tw","HuyaNIUaSqo","4x4魔術方塊復原#1","1hrBLD"},
58
                      //    {"tw","gHho4gJQMXw","4x4魔術方塊復原#2","1hrBLD"},
59
                      //    {"tw","7pbNgXMQxCE","4x4魔術方塊復原#3","1hrBLD"},
60
                      //    {"tw","PZvc5XJ2bLY","4x4魔術方塊復原#4","1hrBLD"},
61
                      //    {"tw","97vDE29lu2o","4x4魔術方塊復原#5","1hrBLD"},
62
                         }
63
        ),
64

    
65
  CUBE5 ( ObjectList.CUBE, 5,
66
          new String[][] {
67
                          {"gb","zMkNkXHzQts","How to Solve the 5x5 Rubik's Cube","Z3"},
68
                          {"es","6uaq-xfFs98","Resolver cubo de Rubik 5x5","Cuby"},
69
                          {"ru","UtKsyLk45uA","Как собрать кубик 5x5","Кубмаркет"},
70
                          {"fr","sq14CsrSkbo","Comment résoudre un Rubik's Cube 5x5","Le Cube"},
71
                          {"pl","ERsPyWOF7mg","Jak ułożyć kostkę 5x5x5","DżoDżo"},
72
                         }
73
        ),
74

    
75
  PYRA3 ( ObjectList.PYRA, 3,
76
          new String[][] {
77
                          {"gb","xIQtn2qazvg","Pyraminx Layer By Layer","Z3"},
78
                          {"es","4cJJe9RAzAU","Resolver Pyraminx","Cuby"},
79
                          {"ru","F4_bhfWyVRQ","Как собрать ПИРАМИДКУ","Е Бондаренко"},
80
                          {"fr","Z2h1YI6jPes","Comment résoudre le Pyraminx","ValentinoCube"},
81
                          {"pl","uNpKpJfAa5I","Jak ułożyć: Pyraminx","DżoDżo"},
82
                      //    {"tw","YS3cDcP6Aro","金字塔方塊解法","1hrBLD"},
83
                         }
84
        ),
85

    
86
  PYRA4 ( ObjectList.PYRA, 4,
87
          new String[][] {
88
                          {"gb","tGQDqDcSa6U","How to Solve the Master Pyraminx","Z3"},
89
                          {"es","74PIPm9-uPg","Resolver Master Pyraminx 4x4","Cuby"},
90
                          {"ru","-F_xJAwkobU","Как собрать Мастер Пираминкс"," Алексей Ярыгин"},
91
                          {"fr","F3gzBs7uvmw","Tuto: résoudre le Master Pyraminx","Spaghetti Cubing"},
92
                          {"pl","EamwvhmHC7Q","4x4 (Master) Pyraminx PL","MrUk"},
93
                         }
94
        ),
95

    
96
  PYRA5 ( ObjectList.PYRA, 5,
97
          new String[][] {
98
                          {"gb","2nsPEECDdN0","Professor Pyraminx Solve","RedKB"},
99
                          {"es","cSDj8OQK3TU","Tutorial del Professor Pyraminx","QBAndo"},
100
                          {"ru","gMp1tbDyDWg","Как собрать Professor Pyraminx","RBcuber"},
101
                         }
102
        ),
103

    
104
  DIAM2 ( ObjectList.DIAM, 2,
105
          new String[][] {
106
                          {"gb","R2wrbJJ3izM","How to Solve a Skewb Diamond","Dr. Penguin^3"},
107
                          {"es","2RCusYQdYYE","Como resolver Skewb Diamond","Tutoriales Rubik"},
108
                          {"ru","k8B6RFcNoGw","Как собрать Skewb Diamond","Алексей Ярыгин"},
109
                          {"fr","tqbkgwNcZCE","Comment résoudre le Skewb Diamond","Valentino Cube"},
110
                          {"pl","61_Z4TpLMBc","Diamond skewb TUTORIAL PL","MrUk"},
111
                         }
112
        ),
113

    
114
  DINO3 ( ObjectList.DINO, 3,
115
          new String[][] {
116
                          {"gb","puTJZqFBQwo","Dino Skewb Cube Tutorial","Bearded Cubing"},
117
                          {"es","6o1Yo5iCxvI","Resolver Cubo Dino","Cuby"},
118
                          {"ru","tWDrCtIv1_U","Как собрать Дино Куб","Алексей Ярыгин"},
119
                          {"fr","hNkpte7Mesc","Comment résoudre le Dino Cube","Valentino Cube"},
120
                          {"pl","o05DYu8UMio","Dino cube TUTORIAL PL","MrUk"},
121
                         }
122
        ),
123

    
124
  REDI3 ( ObjectList.REDI, 3,
125
          new String[][] {
126
                          {"gb","Qn7TJED6O-4","How to Solve the MoYu Redi Cube","Z3"},
127
                          {"es","g0M38Aotgac","Resolver Redi Cube","Cuby"},
128
                          {"ru","ip2wYwc0DMI","Как собрать Реди Куб?","Кубмаркет"},
129
                          {"fr","zw7UZcqqsgA","Comment résoudre le Redi Cube","ValentinoCube"},
130
                          {"pl","vxo3lXMsWQI","Jak ułożyć redi cube?","DJ rubiks"},
131
                         }
132
        ),
133

    
134
  HELI3 ( ObjectList.HELI, 3,
135
          new String[][] {
136
                          {"gb","-suwJpd_PO8","Helicopter Cube Tutorial","Bearded Cubing"},
137
                          {"es","DWG9n_YyGPA","Resolver Helicopter Cube","Cuby"},
138
                          {"ru","V4lJ3pg7Hio","Как собрать Куб Вертолет","Алексей Ярыгин"},
139
                          {"fr","Zk8zWBWD2Ow","Comment résoudre le Helicopter Cube","Julien"},
140
                          {"pl","zoBZame4gFo","Helicopter cube TUTORIAL PL","MrUk"},
141
                         }
142
        ),
143

    
144
  SKEW2 ( ObjectList.SKEW, 2,
145
          new String[][] {
146
                          {"gb","I6132yshkeU","How to Solve the Skewb","Z3"},
147
                          {"es","wxQX3HhPgds","Resolver Skewb (Principiantes)","Cuby"},
148
                          {"ru","_HSKZLC17w4","Как собрать Скьюб?","Кубмаркет"},
149
                          {"fr","lR-GuIroh4k","Comment réussir le skewb","Rachma Nikov"},
150
                          {"pl","ofRu1fByNpk","Jak ułożyć: Skewb","DżoDżo"},
151
                       //   {"tw","8srf9xhsS9k","Skewb斜轉方塊解法","1hrBLD"},
152
                         }
153
        ),
154

    
155
  SKEW3 ( ObjectList.SKEW, 3,
156
          new String[][] {
157
                          {"gb","Jiuf7zQyPYI","Master Skewb Cube Tutorial","Bearded Cubing"},
158
                          {"es","8TP6p63KQCA","Master Skewb en Español","jorlozCubes"},
159
                          {"ru","7155QSp3T74","часть 1: Как собрать мастер Скьюб","Иван Циков"},
160
                          {"ru","14ey-RihjgY","часть 2: Как собрать мастер Скьюб","Иван Циков"},
161
                          {"ru","watq6TLa5_E","часть 2.5: Как собрать мастер Скьюб","Иван Циков"},
162
                          {"ru","UnsvseFBXmo","часть 3: Как собрать мастер Скьюб","Иван Циков"},
163
                          {"pl","Y7l3AYFvDJI","Master skewb TUTORIAL PL","MrUk"},
164
                         }
165
        ),
166

    
167
  IVY2 ( ObjectList.IVY, 2,
168
          new String[][] {
169
                          {"gb","QMzeJobSu1M","How to Solve the Ivy Cube","Z3"},
170
                          {"es","2-Gf2cmEJDs","Resolver Ivy Cube","Cuby"},
171
                          {"ru","pbkfOCnnfsA","Как собрать Иви куб","Алексей Ярыгин"},
172
                          {"fr","mn7YTnYu3Uc","Comment résoudre le Ivy Cube","ValentinoCube"},
173
                          {"pl","8s_0VxNvFA8","Jak ułożyć ivy cube","DubiCube"},
174
                         }
175
        ),
176

    
177
  REX3 ( ObjectList.REX, 3,
178
          new String[][] {
179
                          {"gb","noAQfWqlMbk","Rex Cube Tutorial","CrazyBadCuber"},
180
                          {"es","Q90x9rjLJzw","Resolver Cubo Rex","Cuby"},
181
                          {"ru","Dr9CLM6A3fU","Как собрать Рекс Куб","Алексей Ярыгин"},
182
                          {"fr","SvK1kf6c43c","Résolution du Rex Cube","Asthalis"},
183
                          {"pl","ffbFRnHglWY","Rex cube TUTORIAL PL","MrUk"},
184
                         }
185
        ),
186

    
187
  KILO3( ObjectList.KILO, 3,
188
          new String[][] {
189
                          {"gb","grgGgUSxiQg","How to Solve the Kilominx","Z3"},
190
                          {"es","g6WMYjkCLok","Resolver Kilominx","Cuby"},
191
                          {"ru","gjaknjuZXPs","Киломинкс как собрать","CUBES WORLD"},
192
                          {"fr","F7z6LztN-7A","Résoudre le Kilominx","Twins Cuber"},
193
                          {"pl","tdWh8f8qpq4","Kilominx cube TUTORIAL PL","MrUK"},
194
                         }
195
       ),
196

    
197
  MEGA3( ObjectList.MEGA, 3,
198
          new String[][] {
199
                          {"gb","j4x61L5Onzk","How to Solve the Megaminx","Z3"},
200
                          {"es","xuKbT6Il0Ko","Resolver Megaminx","Cuby"},
201
                          {"ru","WgoguOY3tKI","Как собрать Мегаминкс","Алексей Ярыгин"},
202
                          {"fr","Ln1vl85puKo","Résoudre le Megaminx","Victor Colin"},
203
                          {"pl","BZTW6ApeRZE","Jak ułożyć: Megaminx","DżoDżo"},
204
                         }
205
       );
206

    
207
  public static final int NUM_OBJECTS = values().length;
208
  private final ObjectList mObject;
209
  private final int mSize;
210
  private final String[][] mTutorials;
211
  private final int mNumTutorials;
212

    
213
  private static final TutorialList[] objects;
214

    
215
  static
216
    {
217
    objects = new TutorialList[NUM_OBJECTS];
218
    int i=0;
219

    
220
    for(TutorialList object: TutorialList.values())
221
      {
222
      objects[i++] = object;
223
      }
224
    }
225

    
226
///////////////////////////////////////////////////////////////////////////////////////////////////
227

    
228
  TutorialList(ObjectList object, int size, String[][] tutorials)
229
    {
230
    mObject       = object;
231
    mSize         = size;
232
    mTutorials    = tutorials;
233
    mNumTutorials = mTutorials.length;
234
    }
235

    
236
///////////////////////////////////////////////////////////////////////////////////////////////////
237

    
238
  public static TutorialList getObject(int ordinal)
239
    {
240
    return ordinal>=0 && ordinal<NUM_OBJECTS ? objects[ordinal] : CUBE3;
241
    }
242

    
243
///////////////////////////////////////////////////////////////////////////////////////////////////
244

    
245
  public static int getOrdinal(int objectOrdinal, int size)
246
    {
247
    if( objectOrdinal==ObjectList.DIN4.ordinal() )
248
      {
249
      objectOrdinal= ObjectList.DINO.ordinal();
250
      }
251

    
252
    for(int i=0; i<NUM_OBJECTS; i++)
253
      {
254
      if( objects[i].mObject.ordinal() == objectOrdinal && objects[i].mSize == size )
255
        {
256
        return i;
257
        }
258
      }
259

    
260
    return -1;
261
    }
262

    
263
///////////////////////////////////////////////////////////////////////////////////////////////////
264

    
265
  public ObjectList getObjectList()
266
    {
267
    return mObject;
268
    }
269

    
270
///////////////////////////////////////////////////////////////////////////////////////////////////
271

    
272
  public int getSize()
273
    {
274
    return mSize;
275
    }
276

    
277
///////////////////////////////////////////////////////////////////////////////////////////////////
278

    
279
  public int getNumTutorials()
280
    {
281
    return mNumTutorials;
282
    }
283

    
284
///////////////////////////////////////////////////////////////////////////////////////////////////
285

    
286
  public int getIconID()
287
    {
288
    int sizeIndex = ObjectList.getSizeIndex(mObject.ordinal(),mSize);
289
    return mObject.getIconIDs()[sizeIndex];
290
    }
291

    
292
///////////////////////////////////////////////////////////////////////////////////////////////////
293

    
294
  public String getTutorialLanguage(int index)
295
    {
296
    return ( index>=0 && index<mNumTutorials ) ? mTutorials[index][0] : null;
297
    }
298

    
299
///////////////////////////////////////////////////////////////////////////////////////////////////
300

    
301
  public String getTutorialURL(int index)
302
    {
303
    return ( index>=0 && index<mNumTutorials ) ? mTutorials[index][1] : null;
304
    }
305

    
306
///////////////////////////////////////////////////////////////////////////////////////////////////
307

    
308
  public String getTutorialDescription(int index)
309
    {
310
    return ( index>=0 && index<mNumTutorials ) ? mTutorials[index][2] : null;
311
    }
312

    
313
///////////////////////////////////////////////////////////////////////////////////////////////////
314

    
315
  public String getTutorialAuthor(int index)
316
    {
317
    return ( index>=0 && index<mNumTutorials ) ? mTutorials[index][3] : null;
318
    }
319
}
(2-2/7)