Project

General

Profile

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

magiccube / src / main / java / org / distorted / tutorial / TutorialList.java @ 752f6ce9

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
                          {"cn","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
                          {"cn","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
                          {"cn","HuyaNIUaSqo","4x4魔術方塊復原#1","1hrBLD"},
58
                          {"cn","gHho4gJQMXw","4x4魔術方塊復原#2","1hrBLD"},
59
                          {"cn","7pbNgXMQxCE","4x4魔術方塊復原#3","1hrBLD"},
60
                          {"cn","PZvc5XJ2bLY","4x4魔術方塊復原#4","1hrBLD"},
61
                          {"cn","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
                         }
83
        ),
84

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

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

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

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

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

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

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

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

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

    
175
  public static final int NUM_OBJECTS = values().length;
176
  private ObjectList mObject;
177
  private int mSize;
178
  private String[][] mTutorials;
179
  private int mNumTutorials;
180

    
181
  private static final TutorialList[] objects;
182

    
183
  static
184
    {
185
    objects = new TutorialList[NUM_OBJECTS];
186
    int i=0;
187

    
188
    for(TutorialList object: TutorialList.values())
189
      {
190
      objects[i++] = object;
191
      }
192
    }
193

    
194
///////////////////////////////////////////////////////////////////////////////////////////////////
195

    
196
  TutorialList(ObjectList object, int size, String[][] tutorials)
197
    {
198
    mObject       = object;
199
    mSize         = size;
200
    mTutorials    = tutorials;
201
    mNumTutorials = mTutorials.length;
202
    }
203

    
204
///////////////////////////////////////////////////////////////////////////////////////////////////
205

    
206
  public static TutorialList getObject(int ordinal)
207
    {
208
    return ordinal>=0 && ordinal<NUM_OBJECTS ? objects[ordinal] : CUBE3;
209
    }
210

    
211
///////////////////////////////////////////////////////////////////////////////////////////////////
212

    
213
  public static int getOrdinal(int objectOrdinal, int size)
214
    {
215
    if( objectOrdinal==ObjectList.DIN4.ordinal() )
216
      {
217
      objectOrdinal= ObjectList.DINO.ordinal();
218
      }
219

    
220
    for(int i=0; i<NUM_OBJECTS; i++)
221
      {
222
      if( objects[i].mObject.ordinal() == objectOrdinal && objects[i].mSize == size )
223
        {
224
        return i;
225
        }
226
      }
227

    
228
    return -1;
229
    }
230

    
231
///////////////////////////////////////////////////////////////////////////////////////////////////
232

    
233
  public ObjectList getObjectList()
234
    {
235
    return mObject;
236
    }
237

    
238
///////////////////////////////////////////////////////////////////////////////////////////////////
239

    
240
  public int getSize()
241
    {
242
    return mSize;
243
    }
244

    
245
///////////////////////////////////////////////////////////////////////////////////////////////////
246

    
247
  public int getNumTutorials()
248
    {
249
    return mNumTutorials;
250
    }
251

    
252
///////////////////////////////////////////////////////////////////////////////////////////////////
253

    
254
  public int getIconID()
255
    {
256
    int sizeIndex = ObjectList.getSizeIndex(mObject.ordinal(),mSize);
257
    return mObject.getIconIDs()[sizeIndex];
258
    }
259

    
260
///////////////////////////////////////////////////////////////////////////////////////////////////
261

    
262
  public String getTutorialLanguage(int index)
263
    {
264
    return ( index>=0 && index<mNumTutorials ) ? mTutorials[index][0] : null;
265
    }
266

    
267
///////////////////////////////////////////////////////////////////////////////////////////////////
268

    
269
  public String getTutorialURL(int index)
270
    {
271
    return ( index>=0 && index<mNumTutorials ) ? mTutorials[index][1] : null;
272
    }
273

    
274
///////////////////////////////////////////////////////////////////////////////////////////////////
275

    
276
  public String getTutorialDescription(int index)
277
    {
278
    return ( index>=0 && index<mNumTutorials ) ? mTutorials[index][2] : null;
279
    }
280

    
281
///////////////////////////////////////////////////////////////////////////////////////////////////
282

    
283
  public String getTutorialAuthor(int index)
284
    {
285
    return ( index>=0 && index<mNumTutorials ) ? mTutorials[index][3] : null;
286
    }
287
}
(2-2/7)