Project

General

Profile

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

magiccube / src / main / java / org / distorted / tutorial / TutorialList.java @ 0de39b8e

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ć: 2x2x2 (podstawy)","DżoDżo"},
35
                         }
36
        ),
37

    
38
  CUBE3 ( ObjectList.CUBE, 3,
39
          new String[][] {
40
                          {"gb","-8ohoCKN0Zw","How to Solve a Rubik's Cube","Z3"},
41
                          {"es","GyY0OxDk5lI","Resolver cubo de Rubik 3x3","Cuby"},
42
                          {"ru","5S2eq81FRzI","КАК СОБРАТЬ КУБИК РУБИКА","Евгений Бондаренко"},
43
                          {"fr","T-ASx2wbHVY","Comment résoudre un Rubik's Cube","Le Cube"},
44
                          {"pl","cBU9Y729nQM","Jak ułożyć kostkę Rubika 3x3x3","DżoDżo"},
45
                         }
46
        ),
47

    
48
  CUBE4 ( ObjectList.CUBE, 4,
49
          new String[][] {
50
                          {"gb","RR77Md71Ymc","How to Solve the 4x4 Rubik's Cube","Z3"},
51
                          {"es","d_4xk1r9hxU","Resolver cubo de Rubik 4x4","Cuby"},
52
                          {"ru","aQNVZlWpqXw","Как собрать кубик рубика 4х4","Евгений Бондаренко"},
53
                          {"fr","C83gYXn-zpI","Comment résoudre un Rubik's Cube 4x4","Le Cube"},
54
                          {"pl","LiUxNsowXiI","Jak ułożyć kostkę 4x4x4","DżoDżo"},
55
                         }
56
        ),
57

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

    
68
  PYRA3 ( ObjectList.PYRA, 3,
69
          new String[][] {
70
                          {"gb","xIQtn2qazvg","Pyraminx Layer By Layer","Z3"},
71
                          {"es","4cJJe9RAzAU","Resolver Pyraminx","Cuby"},
72
                          {"ru","F4_bhfWyVRQ","КАК СОБРАТЬ ПИРАМИДКУ","Евгений Бондаренко"},
73
                          {"fr","Z2h1YI6jPes","Comment résoudre le Pyraminx","ValentinoCube"},
74
                          {"pl","uNpKpJfAa5I","Jak ułożyć: Pyraminx","DżoDżo"},
75
                         }
76
        ),
77

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

    
88
  PYRA5 ( ObjectList.PYRA, 5,
89
          new String[][] {
90
                          {"gb","2nsPEECDdN0","Professor Pyraminx Solve","RedKB"},
91
                          {"es","cSDj8OQK3TU","Tutorial del Professor Pyraminx","QBAndo"},
92
                          {"ru","gMp1tbDyDWg","Как собрать Professor Pyraminx","RBcuber"},
93
                         }
94
        ),
95

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

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

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

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

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

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

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

    
168
  public static final int NUM_OBJECTS = values().length;
169
  private ObjectList mObject;
170
  private int mSize;
171
  private String[][] mTutorials;
172
  private int mNumTutorials;
173

    
174
  private static final TutorialList[] objects;
175

    
176
  static
177
    {
178
    objects = new TutorialList[NUM_OBJECTS];
179
    int i=0;
180

    
181
    for(TutorialList object: TutorialList.values())
182
      {
183
      objects[i++] = object;
184
      }
185
    }
186

    
187
///////////////////////////////////////////////////////////////////////////////////////////////////
188

    
189
  TutorialList(ObjectList object, int size, String[][] tutorials)
190
    {
191
    mObject       = object;
192
    mSize         = size;
193
    mTutorials    = tutorials;
194
    mNumTutorials = mTutorials.length;
195
    }
196

    
197
///////////////////////////////////////////////////////////////////////////////////////////////////
198

    
199
  public static TutorialList getObject(int ordinal)
200
    {
201
    return ordinal>=0 && ordinal<NUM_OBJECTS ? objects[ordinal] : CUBE3;
202
    }
203

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

    
206
  public static int getOrdinal(int objectOrdinal, int size)
207
    {
208
    if( objectOrdinal==ObjectList.DIN4.ordinal() )
209
      {
210
      objectOrdinal= ObjectList.DINO.ordinal();
211
      }
212

    
213
    for(int i=0; i<NUM_OBJECTS; i++)
214
      {
215
      if( objects[i].mObject.ordinal() == objectOrdinal && objects[i].mSize == size )
216
        {
217
        return i;
218
        }
219
      }
220

    
221
    return -1;
222
    }
223

    
224
///////////////////////////////////////////////////////////////////////////////////////////////////
225

    
226
  public ObjectList getObjectList()
227
    {
228
    return mObject;
229
    }
230

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

    
233
  public int getSize()
234
    {
235
    return mSize;
236
    }
237

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

    
240
  public int getNumTutorials()
241
    {
242
    return mNumTutorials;
243
    }
244

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

    
247
  public int getIconID()
248
    {
249
    int sizeIndex = ObjectList.getSizeIndex(mObject.ordinal(),mSize);
250
    return mObject.getIconIDs()[sizeIndex];
251
    }
252

    
253
///////////////////////////////////////////////////////////////////////////////////////////////////
254

    
255
  public String getTutorialLanguage(int index)
256
    {
257
    return ( index>=0 && index<mNumTutorials ) ? mTutorials[index][0] : null;
258
    }
259

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

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

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

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

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

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