Project

General

Profile

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

magiccube / src / main / java / org / distorted / objects / RubikObjectList.java @ c5fca790

1 a7d8c3cd Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2021 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.objects;
21
22 804293f0 Leszek Koltunski
import java.util.ArrayList;
23 5e048300 Leszek Koltunski
import java.util.Locale;
24 804293f0 Leszek Koltunski
25 81493402 Leszek Koltunski
import android.content.Context;
26 400ff34d Leszek Koltunski
import android.content.SharedPreferences;
27
28 81493402 Leszek Koltunski
import org.distorted.external.RubikFiles;
29 400ff34d Leszek Koltunski
import org.distorted.main.RubikActivity;
30 e4733ed7 Leszek Koltunski
import org.distorted.objectlib.main.ObjectSignatures;
31 a7d8c3cd Leszek Koltunski
import org.distorted.objectlib.main.ObjectType;
32
33 09cf2a36 Leszek Koltunski
import static org.distorted.objectlib.main.TwistyObject.MESH_NICE;
34 a7d8c3cd Leszek Koltunski
import static org.distorted.objectlib.main.ObjectType.NUM_OBJECTS;
35 e847c553 Leszek Koltunski
import static org.distorted.main.RubikActivity.SHOW_DOWNLOADED_DEBUG;
36 a7d8c3cd Leszek Koltunski
37
///////////////////////////////////////////////////////////////////////////////////////////////////
38
39
public class RubikObjectList
40
{
41 e4733ed7 Leszek Koltunski
  public static final int DEF_OBJECT= ObjectSignatures.CUBE_3;
42 d433b50e Leszek Koltunski
  public static int MAX_LEVEL;
43
44 506f7ceb Leszek Koltunski
  private static RubikObjectList mThis;
45 a7d8c3cd Leszek Koltunski
  private static int mNumObjects;
46 fcf7320f Leszek Koltunski
  private static int mNumExtras;
47 a7d8c3cd Leszek Koltunski
  private static ArrayList<RubikObject> mObjects;
48 400ff34d Leszek Koltunski
  private static int mObject = DEF_OBJECT;
49 a7d8c3cd Leszek Koltunski
50 314e9ff0 Leszek Koltunski
  public static class DownloadedObject
51 506f7ceb Leszek Koltunski
    {
52
    String shortName;
53
    boolean icon,object,extras;
54 84d746d7 Leszek Koltunski
    int numScrambles, objectMinor, extrasMinor;
55 506f7ceb Leszek Koltunski
56 84d746d7 Leszek Koltunski
    DownloadedObject(String sName, int scrambles, int oMinor, int eMinor, boolean i, boolean o, boolean e)
57 506f7ceb Leszek Koltunski
      {
58
      shortName = sName;
59 84d746d7 Leszek Koltunski
60
      numScrambles= scrambles;
61
      objectMinor = oMinor;
62
      extrasMinor = eMinor;
63
64 506f7ceb Leszek Koltunski
      icon   = i;
65
      object = o;
66
      extras = e;
67
      }
68
    }
69
70
  private static ArrayList<DownloadedObject> mDownloadedObjects;
71
72 d433b50e Leszek Koltunski
  static
73
    {
74
    int max = Integer.MIN_VALUE;
75
76
    for (int i=0; i<NUM_OBJECTS; i++)
77
      {
78
      int cur = getDBLevel(i);
79
      if( cur>max ) max = cur;
80
      }
81
82
    MAX_LEVEL = max;
83
    }
84
85 a7d8c3cd Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
86
87
  private RubikObjectList()
88
    {
89 fcf7320f Leszek Koltunski
    mNumObjects= 0;
90
    mNumExtras = 0;
91 804293f0 Leszek Koltunski
92 506f7ceb Leszek Koltunski
    mObjects           = new ArrayList<>();
93
    mDownloadedObjects = new ArrayList<>();
94 a7d8c3cd Leszek Koltunski
95
    createBuiltinObjects();
96
    }
97
98
///////////////////////////////////////////////////////////////////////////////////////////////////
99
100
  private void createBuiltinObjects()
101
    {
102
    for(int i=0; i<NUM_OBJECTS; i++)
103
      {
104
      ObjectType type = ObjectType.getObject(i);
105 d433b50e Leszek Koltunski
      RubikObject obj = new RubikObject(type);
106 a7d8c3cd Leszek Koltunski
      mObjects.add(obj);
107
      mNumObjects++;
108 804293f0 Leszek Koltunski
109 e847c553 Leszek Koltunski
      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "creating local object "+type.name() );
110 84d746d7 Leszek Koltunski
111 314e9ff0 Leszek Koltunski
      if( obj.hasExtras() )
112 804293f0 Leszek Koltunski
        {
113 e847c553 Leszek Koltunski
        if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "has extras "+mNumExtras );
114 84d746d7 Leszek Koltunski
115 fcf7320f Leszek Koltunski
        obj.setExtrasOrdinal(mNumExtras);
116
        mNumExtras++;
117 84d746d7 Leszek Koltunski
        }
118
      else
119
        {
120 e847c553 Leszek Koltunski
        if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "no extras");
121 804293f0 Leszek Koltunski
        }
122 a7d8c3cd Leszek Koltunski
      }
123
    }
124
125 506f7ceb Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
126
127 84d746d7 Leszek Koltunski
  private static boolean internalAddDownloadedObject(DownloadedObject object)
128 506f7ceb Leszek Koltunski
    {
129 314e9ff0 Leszek Koltunski
    String name = object.shortName;
130
131
    for(RubikObject ro : mObjects )
132 84d746d7 Leszek Koltunski
      if( ro.getLowerName().equals(name) )
133 314e9ff0 Leszek Koltunski
        {
134 84d746d7 Leszek Koltunski
        return ro.updateObject(object);
135 314e9ff0 Leszek Koltunski
        }
136
137 84d746d7 Leszek Koltunski
    RubikObject obj = new RubikObject(object);
138
    mObjects.add(obj);
139
    mNumObjects++;
140
141 e847c553 Leszek Koltunski
    if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "creating downloaded object "+obj.getUpperName() );
142 84d746d7 Leszek Koltunski
143
    if( obj.hasExtras() )
144 314e9ff0 Leszek Koltunski
      {
145 e847c553 Leszek Koltunski
      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "has extras "+mNumExtras );
146 506f7ceb Leszek Koltunski
147 84d746d7 Leszek Koltunski
      obj.setExtrasOrdinal(mNumExtras);
148
      mNumExtras++;
149
      }
150
    else
151
      {
152 e847c553 Leszek Koltunski
      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "no extras");
153 314e9ff0 Leszek Koltunski
      }
154 84d746d7 Leszek Koltunski
155
    return true;
156 506f7ceb Leszek Koltunski
    }
157
158 a7d8c3cd Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
159
// PUBLIC API
160 d433b50e Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
161
// historically older versions of the app had lower 'maxScrambles' in case of several objects and
162
// those got remembered in the server-side DB already, so we need to keep using them. This function
163
// provides a map between 'maxScramble' of an object and its 'dbLevel'. All new objects will have
164
// those two values the same.
165
166
  public static int getDBLevel(int ordinal)
167
    {
168 e4733ed7 Leszek Koltunski
    if( ordinal== ObjectSignatures.CUBE_3 ) return 16;
169
    if( ordinal== ObjectSignatures.CUBE_4 ) return 20;
170
    if( ordinal== ObjectSignatures.CUBE_5 ) return 24;
171
    if( ordinal== ObjectSignatures.BAN2_3 ) return 16;
172
    if( ordinal== ObjectSignatures.BAN4_3 ) return 16;
173
    if( ordinal== ObjectSignatures.PYRA_4 ) return 15;
174
    if( ordinal== ObjectSignatures.PYRA_5 ) return 20;
175
    if( ordinal== ObjectSignatures.MEGA_5 ) return 35;
176
    if( ordinal== ObjectSignatures.DIAM_2 ) return 10;
177
    if( ordinal== ObjectSignatures.DIAM_3 ) return 18;
178
    if( ordinal== ObjectSignatures.REDI_3 ) return 14;
179
    if( ordinal== ObjectSignatures.HELI_3 ) return 18;
180
    if( ordinal== ObjectSignatures.SKEW_3 ) return 17;
181
    if( ordinal== ObjectSignatures.REX_3  ) return 16;
182
    if( ordinal== ObjectSignatures.MIRR_3 ) return 16;
183 d433b50e Leszek Koltunski
184 dd8c5356 Leszek Koltunski
    // in 1.9.6 & 1.9.7 there is a bug with downloadable objects (in this very function!):
185
    // All of those have DBLevel equal to CUBE_3's DBlevel (in 1.9.7!), i.e. 17.
186
    // This will be a problem when we release a new version of the app which has some of the
187
    // previously downloadable objects built-in. Thus: in case of those, we need to keep using
188
    // 17.
189
190
    if( ObjectType.wasDownloadableButNowIsBuiltIn(ordinal) )
191
      {
192
      return 17;
193
      }
194
195
    return ObjectType.getObject(ordinal).getNumScramble();
196 d433b50e Leszek Koltunski
    }
197
198 806329e3 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
199
200 81493402 Leszek Koltunski
  public static void addDownloadedObject(Context context, String shortName, int numScrambles, int objectMinor,
201
                                         int extrasMinor, boolean icon, boolean object, boolean extras)
202 806329e3 Leszek Koltunski
    {
203 c89c3b1b Leszek Koltunski
    if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "New downloaded object "+shortName+" icon="+icon+" object="+object+" extras="+extras);
204
205 506f7ceb Leszek Koltunski
    for( DownloadedObject obj : mDownloadedObjects )
206
      {
207
      if( obj.shortName.equals(shortName) )
208
        {
209
        obj.icon  |= icon;
210
        obj.object|= object;
211
        obj.extras|= extras;
212
213 c89c3b1b Leszek Koltunski
        if( !obj.object ) objectMinor=-1;
214
        if( !obj.extras ) extrasMinor=-1;
215
216
        obj.objectMinor = objectMinor;
217
        obj.extrasMinor = extrasMinor;
218
219
        if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "Updating downloaded object "+shortName+" icon="+obj.icon+" object="+obj.object+" extras="+obj.extras);
220 506f7ceb Leszek Koltunski
221 41a5dd89 Leszek Koltunski
        try
222
          {
223
          RubikActivity ract = (RubikActivity)context;
224
          ract.reloadObject(shortName);
225
          }
226
        catch(Exception ex)
227
          {
228
          android.util.Log.e("D", "exception trying to reload object: "+ex.getMessage() );
229
          }
230
231 506f7ceb Leszek Koltunski
        return;
232
        }
233
      }
234
235 c89c3b1b Leszek Koltunski
    if( !object ) objectMinor=-1;
236
    if( !extras ) extrasMinor=-1;
237
238
    DownloadedObject obj = new DownloadedObject(shortName,numScrambles,objectMinor,extrasMinor,icon,object,extras);
239
    if ( internalAddDownloadedObject(obj) )
240 84d746d7 Leszek Koltunski
      {
241 c89c3b1b Leszek Koltunski
      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "Adding new downloaded object "+shortName+" icon="+obj.icon+" object="+obj.object+" extras="+obj.extras);
242
      mDownloadedObjects.add(obj);
243 84d746d7 Leszek Koltunski
      }
244 81493402 Leszek Koltunski
    else
245
      {
246
      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "New downloaded object "+shortName+" is already built-in, deleting");
247
248 7e9139c1 Leszek Koltunski
      mDownloadedObjects.remove(obj);
249 81493402 Leszek Koltunski
      RubikFiles files = RubikFiles.getInstance();
250
      files.deleteIcon(context,shortName);
251
      files.deleteJsonObject(context,shortName);
252
      files.deleteJsonExtras(context,shortName);
253
      }
254 806329e3 Leszek Koltunski
    }
255
256 f12e4de9 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
257
258
  public static void setMeshState(int ordinal, int state)
259
    {
260
    if( ordinal>=0 && ordinal<mNumObjects ) mObjects.get(ordinal).setMeshState(state);
261
    }
262
263
///////////////////////////////////////////////////////////////////////////////////////////////////
264
265
  public static int getMeshState(int ordinal)
266
    {
267
    return (ordinal>=0 && ordinal<mNumObjects) ? mObjects.get(ordinal).getMeshState() : MESH_NICE;
268
    }
269
270 400ff34d Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
271
272
  public static void savePreferences(SharedPreferences.Editor editor)
273
    {
274 f12e4de9 Leszek Koltunski
    RubikObject obj = getObject(mObject);
275 84d746d7 Leszek Koltunski
    if( obj!=null ) editor.putString("rol_objName", obj.getUpperName() );
276 506f7ceb Leszek Koltunski
277
    int numDownloaded = mDownloadedObjects.size();
278
279
    if( numDownloaded>0 )
280
      {
281
      StringBuilder downloadedObjects = new StringBuilder();
282
283
      for(int i=0; i<numDownloaded; i++)
284
        {
285
        if( i>0 ) downloadedObjects.append(',');
286
287
        DownloadedObject object = mDownloadedObjects.get(i);
288
        downloadedObjects.append(object.shortName);
289
        downloadedObjects.append(' ');
290 84d746d7 Leszek Koltunski
        downloadedObjects.append(object.numScrambles);
291
        downloadedObjects.append(' ');
292
        downloadedObjects.append(object.objectMinor);
293
        downloadedObjects.append(' ');
294
        downloadedObjects.append(object.extrasMinor);
295
        downloadedObjects.append(' ');
296 506f7ceb Leszek Koltunski
        downloadedObjects.append(object.icon   ? "1":"0");
297
        downloadedObjects.append(' ');
298
        downloadedObjects.append(object.object ? "1":"0");
299
        downloadedObjects.append(' ');
300
        downloadedObjects.append(object.extras ? "1":"0");
301
        }
302
303 84d746d7 Leszek Koltunski
      String objects = downloadedObjects.toString();
304 e847c553 Leszek Koltunski
      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "saving: "+objects);
305 84d746d7 Leszek Koltunski
      editor.putString("rol_downloaded", objects );
306 506f7ceb Leszek Koltunski
      }
307 7e9139c1 Leszek Koltunski
    else
308
      {
309
      editor.putString("rol_downloaded", "" );
310
      }
311 f12e4de9 Leszek Koltunski
    }
312 400ff34d Leszek Koltunski
313 f12e4de9 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
314
315
  public static void saveMeshState(SharedPreferences.Editor editor)
316
    {
317
    for(int i=0; i<mNumObjects; i++)
318 400ff34d Leszek Koltunski
      {
319 f12e4de9 Leszek Koltunski
      RubikObject obj = getObject(i);
320
321
      if( obj!=null )
322
        {
323 84d746d7 Leszek Koltunski
        String name = obj.getUpperName();
324 f12e4de9 Leszek Koltunski
        editor.putInt("rol_"+name, obj.getMeshState() );
325
        }
326 400ff34d Leszek Koltunski
      }
327
    }
328
329
///////////////////////////////////////////////////////////////////////////////////////////////////
330
331 81493402 Leszek Koltunski
  public static void restorePreferences(Context context, SharedPreferences preferences)
332 400ff34d Leszek Koltunski
    {
333 526a5906 Leszek Koltunski
    if( mThis==null ) mThis = new RubikObjectList();
334
335 506f7ceb Leszek Koltunski
    String downloaded = preferences.getString("rol_downloaded","");
336
337 e847c553 Leszek Koltunski
    if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", downloaded);
338 506f7ceb Leszek Koltunski
339
    if( !downloaded.equals(""))
340
      {
341
      String[] dObjects = downloaded.split(",");
342
343
      for(String dObj : dObjects)
344
        {
345
        String[] parts = dObj.split(" ");
346
347 84d746d7 Leszek Koltunski
        if( parts.length==7 )
348 506f7ceb Leszek Koltunski
          {
349
          String name = parts[0];
350 84d746d7 Leszek Koltunski
          String scra = parts[1];
351
          String objM = parts[2];
352
          String extM = parts[3];
353
          String icon = parts[4];
354
          String obje = parts[5];
355
          String extr = parts[6];
356
357
          int scrambles = Integer.parseInt(scra);
358
          int oMinor    = Integer.parseInt(objM);
359
          int eMinor    = Integer.parseInt(extM);
360 506f7ceb Leszek Koltunski
361
          boolean bIcon = icon.equals("1");
362
          boolean bObje = obje.equals("1");
363
          boolean bExtr = extr.equals("1");
364
365 81493402 Leszek Koltunski
          addDownloadedObject(context,name,scrambles,oMinor,eMinor,bIcon,bObje,bExtr);
366 506f7ceb Leszek Koltunski
          }
367
        }
368
      }
369 d9d2c5fb Leszek Koltunski
370
    RubikObject object = getObject(DEF_OBJECT);
371
    String defName = object==null ? "CUBE_3" : object.getUpperName();
372
    String objName= preferences.getString("rol_objName",defName);
373
    mObject = getOrdinal(objName);
374
    if( mObject<0 || mObject>=mNumObjects ) mObject = DEF_OBJECT;
375 400ff34d Leszek Koltunski
    }
376
377 f12e4de9 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
378
379
  public static void restoreMeshState(SharedPreferences preferences)
380
    {
381
    for(int i=0; i<mNumObjects; i++)
382
      {
383
      RubikObject obj = getObject(i);
384
385
      if( obj!=null )
386
        {
387 84d746d7 Leszek Koltunski
        String name  = obj.getUpperName();
388 f12e4de9 Leszek Koltunski
        int meshState= preferences.getInt("rol_"+name,MESH_NICE);
389
        obj.setMeshState(meshState);
390
        }
391
      }
392
    }
393
394 400ff34d Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
395
396 c5fca790 Leszek Koltunski
  public static boolean setCurrObject(int ordinal)
397 400ff34d Leszek Koltunski
    {
398
    if( mObject!=ordinal )
399
      {
400
      mObject = ordinal;
401
      return true;
402
      }
403
404
    return false;
405
    }
406
407
///////////////////////////////////////////////////////////////////////////////////////////////////
408
409
  public static int getCurrObject()
410
    {
411
    return mObject;
412
    }
413
414 d433b50e Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
415 a7d8c3cd Leszek Koltunski
416
  public static RubikObject getObject(int ordinal)
417
    {
418 506f7ceb Leszek Koltunski
    if( mThis==null ) mThis = new RubikObjectList();
419 a7d8c3cd Leszek Koltunski
    return ordinal>=0 && ordinal<mNumObjects ? mObjects.get(ordinal) : null;
420
    }
421
422 41a5dd89 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
423
424
  public static RubikObject getObject(String shortUpperName)
425
    {
426
    if( mThis==null ) mThis = new RubikObjectList();
427
428
    for(int i=0; i<mNumObjects; i++)
429
      {
430
      RubikObject object = mObjects.get(i);
431
      if( object.getUpperName().equals(shortUpperName) )
432
        {
433
        return object;
434
        }
435
      }
436
437
    return null;
438
    }
439
440 a7d8c3cd Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
441
442
  public static int getNumObjects()
443
    {
444 506f7ceb Leszek Koltunski
    if( mThis==null ) mThis = new RubikObjectList();
445 a7d8c3cd Leszek Koltunski
    return mNumObjects;
446
    }
447
448
///////////////////////////////////////////////////////////////////////////////////////////////////
449
450
  public static int getOrdinal(String name)
451
    {
452 506f7ceb Leszek Koltunski
    if( mThis==null ) mThis = new RubikObjectList();
453 a7d8c3cd Leszek Koltunski
454 5e048300 Leszek Koltunski
    String lowerName = name.toLowerCase(Locale.ENGLISH);
455 84d746d7 Leszek Koltunski
456 a7d8c3cd Leszek Koltunski
    for(int i=0; i<mNumObjects; i++)
457
      {
458
      RubikObject obj = mObjects.get(i);
459 84d746d7 Leszek Koltunski
      if( obj.getLowerName().equals(lowerName) ) return i;
460 a7d8c3cd Leszek Koltunski
      }
461
462
    return -1;
463
    }
464 804293f0 Leszek Koltunski
465 fcf7320f Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
466
467
  public static int getNumExtrasObjects()
468
    {
469
    return mNumExtras;
470
    }
471
472 804293f0 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
473
474
  public static int getNumTutorialObjects()
475
    {
476 fcf7320f Leszek Koltunski
    return mNumExtras;
477 804293f0 Leszek Koltunski
    }
478
479
///////////////////////////////////////////////////////////////////////////////////////////////////
480
481 fcf7320f Leszek Koltunski
  public static int getObjectOrdinal(int extrasOrdinal)
482 804293f0 Leszek Koltunski
    {
483 fcf7320f Leszek Koltunski
    for(int i=extrasOrdinal; i<mNumObjects; i++)
484 804293f0 Leszek Koltunski
      {
485
      RubikObject object = getObject(i);
486 fcf7320f Leszek Koltunski
      int extOrd = object!=null ? object.getExtrasOrdinal() : -1;
487
      if( extOrd==extrasOrdinal ) return i;
488 804293f0 Leszek Koltunski
      }
489
490
    return -1;
491
    }
492
493 fcf7320f Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
494
495
  public static int getExtrasOrdinal(int objectOrdinal)
496
    {
497
    RubikObject object = getObject(objectOrdinal);
498
    return object!=null ? object.getExtrasOrdinal() : -1;
499
    }
500
501 804293f0 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
502
503
  public static int getTutorialOrdinal(int objectOrdinal)
504
    {
505
    RubikObject object = getObject(objectOrdinal);
506 fcf7320f Leszek Koltunski
    return object!=null ? object.getExtrasOrdinal() : -1;
507
    }
508
509
///////////////////////////////////////////////////////////////////////////////////////////////////
510
511
  public static int getLocalObjectMinor(int objectOrdinal)
512
    {
513
    RubikObject object = getObject(objectOrdinal);
514
    return object!=null ? object.getObjectMinor() : -1;
515
    }
516
517
///////////////////////////////////////////////////////////////////////////////////////////////////
518
519
  public static int getLocalExtrasMinor(int objectOrdinal)
520
    {
521
    RubikObject object = getObject(objectOrdinal);
522
    return object!=null ? object.getExtrasMinor() : -1;
523 804293f0 Leszek Koltunski
    }
524 a7d8c3cd Leszek Koltunski
}