Project

General

Profile

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

magiccube / src / main / java / org / distorted / objects / RubikObjectList.java @ 9b763e1c

1 a7d8c3cd Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2021 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6 f05e0259 Leszek Koltunski
// Magic Cube is proprietary software licensed under an EULA which you should have received      //
7
// along with the code. If not, check https://distorted.org/magic/License-Magic-Cube.html        //
8 a7d8c3cd Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
9
10
package org.distorted.objects;
11
12 804293f0 Leszek Koltunski
import java.util.ArrayList;
13 5e048300 Leszek Koltunski
import java.util.Locale;
14 804293f0 Leszek Koltunski
15 81493402 Leszek Koltunski
import android.content.Context;
16 400ff34d Leszek Koltunski
import android.content.SharedPreferences;
17
18 81493402 Leszek Koltunski
import org.distorted.external.RubikFiles;
19 400ff34d Leszek Koltunski
import org.distorted.main.RubikActivity;
20 e4733ed7 Leszek Koltunski
import org.distorted.objectlib.main.ObjectSignatures;
21 a7d8c3cd Leszek Koltunski
import org.distorted.objectlib.main.ObjectType;
22
23 09cf2a36 Leszek Koltunski
import static org.distorted.objectlib.main.TwistyObject.MESH_NICE;
24 a7d8c3cd Leszek Koltunski
import static org.distorted.objectlib.main.ObjectType.NUM_OBJECTS;
25 e847c553 Leszek Koltunski
import static org.distorted.main.RubikActivity.SHOW_DOWNLOADED_DEBUG;
26 a7d8c3cd Leszek Koltunski
27
///////////////////////////////////////////////////////////////////////////////////////////////////
28
29
public class RubikObjectList
30
{
31 e4733ed7 Leszek Koltunski
  public static final int DEF_OBJECT= ObjectSignatures.CUBE_3;
32 506f7ceb Leszek Koltunski
  private static RubikObjectList mThis;
33 a7d8c3cd Leszek Koltunski
  private static int mNumObjects;
34 fcf7320f Leszek Koltunski
  private static int mNumExtras;
35 a7d8c3cd Leszek Koltunski
  private static ArrayList<RubikObject> mObjects;
36 400ff34d Leszek Koltunski
  private static int mObject = DEF_OBJECT;
37 a7d8c3cd Leszek Koltunski
38 314e9ff0 Leszek Koltunski
  public static class DownloadedObject
39 506f7ceb Leszek Koltunski
    {
40
    String shortName;
41 80f574a1 Leszek Koltunski
    boolean icon,object,extras,free;
42 84d746d7 Leszek Koltunski
    int numScrambles, objectMinor, extrasMinor;
43 506f7ceb Leszek Koltunski
44 80f574a1 Leszek Koltunski
    DownloadedObject(String sName, int scrambles, boolean isFree, int oMinor, int eMinor, boolean i, boolean o, boolean e)
45 506f7ceb Leszek Koltunski
      {
46
      shortName = sName;
47 84d746d7 Leszek Koltunski
48
      numScrambles= scrambles;
49 80f574a1 Leszek Koltunski
      free        = isFree;
50 84d746d7 Leszek Koltunski
      objectMinor = oMinor;
51
      extrasMinor = eMinor;
52
53 506f7ceb Leszek Koltunski
      icon   = i;
54
      object = o;
55
      extras = e;
56
      }
57
    }
58
59
  private static ArrayList<DownloadedObject> mDownloadedObjects;
60 9b763e1c Leszek Koltunski
  private static String mFreeSolvedObjects;
61
  private static String mFreeBoughtObjects;
62 506f7ceb Leszek Koltunski
63 a7d8c3cd Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
64
65
  private RubikObjectList()
66
    {
67 fcf7320f Leszek Koltunski
    mNumObjects= 0;
68
    mNumExtras = 0;
69 804293f0 Leszek Koltunski
70 506f7ceb Leszek Koltunski
    mObjects           = new ArrayList<>();
71
    mDownloadedObjects = new ArrayList<>();
72 a7d8c3cd Leszek Koltunski
73
    createBuiltinObjects();
74
    }
75
76
///////////////////////////////////////////////////////////////////////////////////////////////////
77
78
  private void createBuiltinObjects()
79
    {
80
    for(int i=0; i<NUM_OBJECTS; i++)
81
      {
82
      ObjectType type = ObjectType.getObject(i);
83 d433b50e Leszek Koltunski
      RubikObject obj = new RubikObject(type);
84 a7d8c3cd Leszek Koltunski
      mObjects.add(obj);
85
      mNumObjects++;
86 804293f0 Leszek Koltunski
87 e847c553 Leszek Koltunski
      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "creating local object "+type.name() );
88 84d746d7 Leszek Koltunski
89 314e9ff0 Leszek Koltunski
      if( obj.hasExtras() )
90 804293f0 Leszek Koltunski
        {
91 e847c553 Leszek Koltunski
        if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "has extras "+mNumExtras );
92 84d746d7 Leszek Koltunski
93 fcf7320f Leszek Koltunski
        obj.setExtrasOrdinal(mNumExtras);
94
        mNumExtras++;
95 84d746d7 Leszek Koltunski
        }
96
      else
97
        {
98 e847c553 Leszek Koltunski
        if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "no extras");
99 804293f0 Leszek Koltunski
        }
100 a7d8c3cd Leszek Koltunski
      }
101
    }
102
103 506f7ceb Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
104
105 84d746d7 Leszek Koltunski
  private static boolean internalAddDownloadedObject(DownloadedObject object)
106 506f7ceb Leszek Koltunski
    {
107 314e9ff0 Leszek Koltunski
    String name = object.shortName;
108
109
    for(RubikObject ro : mObjects )
110 84d746d7 Leszek Koltunski
      if( ro.getLowerName().equals(name) )
111 314e9ff0 Leszek Koltunski
        {
112 84d746d7 Leszek Koltunski
        return ro.updateObject(object);
113 314e9ff0 Leszek Koltunski
        }
114
115 84d746d7 Leszek Koltunski
    RubikObject obj = new RubikObject(object);
116
    mObjects.add(obj);
117
    mNumObjects++;
118
119 e847c553 Leszek Koltunski
    if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "creating downloaded object "+obj.getUpperName() );
120 84d746d7 Leszek Koltunski
121
    if( obj.hasExtras() )
122 314e9ff0 Leszek Koltunski
      {
123 e847c553 Leszek Koltunski
      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "has extras "+mNumExtras );
124 506f7ceb Leszek Koltunski
125 84d746d7 Leszek Koltunski
      obj.setExtrasOrdinal(mNumExtras);
126
      mNumExtras++;
127
      }
128
    else
129
      {
130 e847c553 Leszek Koltunski
      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "no extras");
131 314e9ff0 Leszek Koltunski
      }
132 84d746d7 Leszek Koltunski
133
    return true;
134 506f7ceb Leszek Koltunski
    }
135
136 a7d8c3cd Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
137
// PUBLIC API
138 806329e3 Leszek Koltunski
139 80f574a1 Leszek Koltunski
  public static boolean addDownloadedObject(Context context, String shortName, int numScrambles, boolean isFree, int objectMinor,
140 81493402 Leszek Koltunski
                                         int extrasMinor, boolean icon, boolean object, boolean extras)
141 806329e3 Leszek Koltunski
    {
142 c89c3b1b Leszek Koltunski
    if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "New downloaded object "+shortName+" icon="+icon+" object="+object+" extras="+extras);
143
144 506f7ceb Leszek Koltunski
    for( DownloadedObject obj : mDownloadedObjects )
145
      {
146
      if( obj.shortName.equals(shortName) )
147
        {
148
        obj.icon  |= icon;
149
        obj.object|= object;
150
        obj.extras|= extras;
151
152 c89c3b1b Leszek Koltunski
        if( !obj.object ) objectMinor=-1;
153
        if( !obj.extras ) extrasMinor=-1;
154
155
        obj.objectMinor = objectMinor;
156
        obj.extrasMinor = extrasMinor;
157
158
        if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "Updating downloaded object "+shortName+" icon="+obj.icon+" object="+obj.object+" extras="+obj.extras);
159 506f7ceb Leszek Koltunski
160 41a5dd89 Leszek Koltunski
        try
161
          {
162
          RubikActivity ract = (RubikActivity)context;
163
          ract.reloadObject(shortName);
164
          }
165
        catch(Exception ex)
166
          {
167
          android.util.Log.e("D", "exception trying to reload object: "+ex.getMessage() );
168
          }
169
170 ac1900c3 Leszek Koltunski
        return false;
171 506f7ceb Leszek Koltunski
        }
172
      }
173
174 c89c3b1b Leszek Koltunski
    if( !object ) objectMinor=-1;
175
    if( !extras ) extrasMinor=-1;
176
177 80f574a1 Leszek Koltunski
    DownloadedObject obj = new DownloadedObject(shortName,numScrambles,isFree,objectMinor,extrasMinor,icon,object,extras);
178 c89c3b1b Leszek Koltunski
    if ( internalAddDownloadedObject(obj) )
179 84d746d7 Leszek Koltunski
      {
180 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);
181
      mDownloadedObjects.add(obj);
182 ac1900c3 Leszek Koltunski
      return true;
183 84d746d7 Leszek Koltunski
      }
184 81493402 Leszek Koltunski
    else
185
      {
186
      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "New downloaded object "+shortName+" is already built-in, deleting");
187
      RubikFiles files = RubikFiles.getInstance();
188
      files.deleteIcon(context,shortName);
189
      files.deleteJsonObject(context,shortName);
190
      files.deleteJsonExtras(context,shortName);
191 ac1900c3 Leszek Koltunski
      return false;
192 81493402 Leszek Koltunski
      }
193 806329e3 Leszek Koltunski
    }
194
195 f12e4de9 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
196
197
  public static void setMeshState(int ordinal, int state)
198
    {
199
    if( ordinal>=0 && ordinal<mNumObjects ) mObjects.get(ordinal).setMeshState(state);
200
    }
201
202
///////////////////////////////////////////////////////////////////////////////////////////////////
203
204
  public static int getMeshState(int ordinal)
205
    {
206
    return (ordinal>=0 && ordinal<mNumObjects) ? mObjects.get(ordinal).getMeshState() : MESH_NICE;
207
    }
208
209 9b763e1c Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
210
211
  public static void saveMeshState(SharedPreferences.Editor editor)
212
    {
213
    for(int i=0; i<mNumObjects; i++)
214
      {
215
      RubikObject obj = getObject(i);
216
217
      if( obj!=null )
218
        {
219
        String name = obj.getUpperName();
220
        editor.putInt("rol_"+name, obj.getMeshState() );
221
        }
222
      }
223
    }
224
225
///////////////////////////////////////////////////////////////////////////////////////////////////
226
227
  public static void buyAll()
228
    {
229
    mFreeBoughtObjects = "*";
230
231
    for(int i=0; i<mNumObjects; i++)
232
      {
233
      RubikObject o = mObjects.get(i);
234
      o.markFree();
235
      }
236
    }
237
238
///////////////////////////////////////////////////////////////////////////////////////////////////
239
240
  public static boolean buyObject(String shortName)
241
    {
242
    RubikObject o = getObject(shortName);
243
244
    if( o!=null && !o.isFree() )
245
      {
246
      o.markFree();
247
      mFreeBoughtObjects += (","+shortName);
248
      return true;
249
      }
250
251
    return false;
252
    }
253
254
///////////////////////////////////////////////////////////////////////////////////////////////////
255
256
  public static boolean solveObject(String shortName)
257
    {
258
    RubikObject o = getObject(shortName);
259
260
    if( o!=null && !o.isFree() )
261
      {
262
      o.markFree();
263
      mFreeSolvedObjects += (","+shortName);
264
      return true;
265
      }
266
267
    return false;
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 80f574a1 Leszek Koltunski
        downloadedObjects.append(' ');
302
        downloadedObjects.append(object.free ? "true":"false");
303 506f7ceb Leszek Koltunski
        }
304
305 84d746d7 Leszek Koltunski
      String objects = downloadedObjects.toString();
306 e847c553 Leszek Koltunski
      if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "saving: "+objects);
307 84d746d7 Leszek Koltunski
      editor.putString("rol_downloaded", objects );
308 506f7ceb Leszek Koltunski
      }
309 7e9139c1 Leszek Koltunski
    else
310
      {
311
      editor.putString("rol_downloaded", "" );
312
      }
313 f12e4de9 Leszek Koltunski
314 9b763e1c Leszek Koltunski
    editor.putString("rol_freeSolved", mFreeSolvedObjects);
315
    editor.putString("rol_freeBought", mFreeBoughtObjects);
316 400ff34d Leszek Koltunski
    }
317
318
///////////////////////////////////////////////////////////////////////////////////////////////////
319
320 81493402 Leszek Koltunski
  public static void restorePreferences(Context context, SharedPreferences preferences)
321 400ff34d Leszek Koltunski
    {
322 526a5906 Leszek Koltunski
    if( mThis==null ) mThis = new RubikObjectList();
323
324 506f7ceb Leszek Koltunski
    String downloaded = preferences.getString("rol_downloaded","");
325
326 e847c553 Leszek Koltunski
    if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", downloaded);
327 506f7ceb Leszek Koltunski
328
    if( !downloaded.equals(""))
329
      {
330
      String[] dObjects = downloaded.split(",");
331
332
      for(String dObj : dObjects)
333
        {
334
        String[] parts = dObj.split(" ");
335 80f574a1 Leszek Koltunski
        int length = parts.length;
336 506f7ceb Leszek Koltunski
337 80f574a1 Leszek Koltunski
        if( length==7 || length==8 )
338 506f7ceb Leszek Koltunski
          {
339
          String name = parts[0];
340 84d746d7 Leszek Koltunski
          String scra = parts[1];
341
          String objM = parts[2];
342
          String extM = parts[3];
343
          String icon = parts[4];
344
          String obje = parts[5];
345
          String extr = parts[6];
346 80f574a1 Leszek Koltunski
          boolean isFree = (length==7 || Boolean.parseBoolean(parts[7]));
347 84d746d7 Leszek Koltunski
348
          int scrambles = Integer.parseInt(scra);
349
          int oMinor    = Integer.parseInt(objM);
350
          int eMinor    = Integer.parseInt(extM);
351 506f7ceb Leszek Koltunski
352
          boolean bIcon = icon.equals("1");
353
          boolean bObje = obje.equals("1");
354
          boolean bExtr = extr.equals("1");
355
356 80f574a1 Leszek Koltunski
          addDownloadedObject(context,name,scrambles,isFree,oMinor,eMinor,bIcon,bObje,bExtr);
357 506f7ceb Leszek Koltunski
          }
358
        }
359
      }
360 d9d2c5fb Leszek Koltunski
361
    RubikObject object = getObject(DEF_OBJECT);
362
    String defName = object==null ? "CUBE_3" : object.getUpperName();
363
    String objName= preferences.getString("rol_objName",defName);
364
    mObject = getOrdinal(objName);
365
    if( mObject<0 || mObject>=mNumObjects ) mObject = DEF_OBJECT;
366 9b763e1c Leszek Koltunski
367
    mFreeSolvedObjects = preferences.getString("rol_freeSolved", "");
368
    mFreeBoughtObjects = preferences.getString("rol_freeBought", "");
369
370
    if( mFreeBoughtObjects.length()>0 )
371
      {
372
      if( mFreeBoughtObjects.charAt(0)=='*' )
373
        {
374
        for(int i=0; i<mNumObjects; i++)
375
          {
376
          RubikObject o = mObjects.get(i);
377
          o.markFree();
378
          }
379
        }
380
      else
381
        {
382
        String[] objs = mFreeBoughtObjects.split(",");
383
384
        for( String obj : objs )
385
          {
386
          RubikObject o = getObject(obj);
387
          if( o!=null ) o.markFree();
388
          }
389
        }
390
      }
391
392
    if( mFreeSolvedObjects.length()>0 )
393
      {
394
      String[] objs = mFreeSolvedObjects.split(",");
395
396
      for( String obj : objs )
397
        {
398
        RubikObject o = getObject(obj);
399
        if( o!=null ) o.markFree();
400
        }
401
      }
402 400ff34d Leszek Koltunski
    }
403
404 f12e4de9 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
405
406
  public static void restoreMeshState(SharedPreferences preferences)
407
    {
408
    for(int i=0; i<mNumObjects; i++)
409
      {
410
      RubikObject obj = getObject(i);
411
412
      if( obj!=null )
413
        {
414 84d746d7 Leszek Koltunski
        String name  = obj.getUpperName();
415 f12e4de9 Leszek Koltunski
        int meshState= preferences.getInt("rol_"+name,MESH_NICE);
416
        obj.setMeshState(meshState);
417
        }
418
      }
419
    }
420
421 400ff34d Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
422
423 1088a219 Leszek Koltunski
  public static boolean setCurrObject(int ordinal)
424 400ff34d Leszek Koltunski
    {
425
    if( mObject!=ordinal )
426
      {
427
      mObject = ordinal;
428
      return true;
429
      }
430
431
    return false;
432
    }
433
434
///////////////////////////////////////////////////////////////////////////////////////////////////
435
436
  public static int getCurrObject()
437
    {
438
    return mObject;
439
    }
440
441 69b66386 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
442
443
  public static String getCurrentName()
444
    {
445
    RubikObject object = mObjects.get(mObject);
446
    return object==null ? "" : object.getUpperName();
447
    }
448
449 d433b50e Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
450 a7d8c3cd Leszek Koltunski
451
  public static RubikObject getObject(int ordinal)
452
    {
453 506f7ceb Leszek Koltunski
    if( mThis==null ) mThis = new RubikObjectList();
454 a7d8c3cd Leszek Koltunski
    return ordinal>=0 && ordinal<mNumObjects ? mObjects.get(ordinal) : null;
455
    }
456
457 41a5dd89 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
458
459
  public static RubikObject getObject(String shortUpperName)
460
    {
461
    if( mThis==null ) mThis = new RubikObjectList();
462
463
    for(int i=0; i<mNumObjects; i++)
464
      {
465
      RubikObject object = mObjects.get(i);
466
      if( object.getUpperName().equals(shortUpperName) )
467
        {
468
        return object;
469
        }
470
      }
471
472
    return null;
473
    }
474
475 a7d8c3cd Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
476
477
  public static int getNumObjects()
478
    {
479 506f7ceb Leszek Koltunski
    if( mThis==null ) mThis = new RubikObjectList();
480 a7d8c3cd Leszek Koltunski
    return mNumObjects;
481
    }
482
483
///////////////////////////////////////////////////////////////////////////////////////////////////
484
485
  public static int getOrdinal(String name)
486
    {
487 506f7ceb Leszek Koltunski
    if( mThis==null ) mThis = new RubikObjectList();
488 a7d8c3cd Leszek Koltunski
489 5e048300 Leszek Koltunski
    String lowerName = name.toLowerCase(Locale.ENGLISH);
490 84d746d7 Leszek Koltunski
491 a7d8c3cd Leszek Koltunski
    for(int i=0; i<mNumObjects; i++)
492
      {
493
      RubikObject obj = mObjects.get(i);
494 84d746d7 Leszek Koltunski
      if( obj.getLowerName().equals(lowerName) ) return i;
495 a7d8c3cd Leszek Koltunski
      }
496
497
    return -1;
498
    }
499 804293f0 Leszek Koltunski
500 fcf7320f Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
501
502
  public static int getNumExtrasObjects()
503
    {
504
    return mNumExtras;
505
    }
506
507 804293f0 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
508
509
  public static int getNumTutorialObjects()
510
    {
511 fcf7320f Leszek Koltunski
    return mNumExtras;
512 804293f0 Leszek Koltunski
    }
513
514
///////////////////////////////////////////////////////////////////////////////////////////////////
515
516 fcf7320f Leszek Koltunski
  public static int getObjectOrdinal(int extrasOrdinal)
517 804293f0 Leszek Koltunski
    {
518 fcf7320f Leszek Koltunski
    for(int i=extrasOrdinal; i<mNumObjects; i++)
519 804293f0 Leszek Koltunski
      {
520
      RubikObject object = getObject(i);
521 fcf7320f Leszek Koltunski
      int extOrd = object!=null ? object.getExtrasOrdinal() : -1;
522
      if( extOrd==extrasOrdinal ) return i;
523 804293f0 Leszek Koltunski
      }
524
525
    return -1;
526
    }
527
528 fcf7320f Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
529
530
  public static int getExtrasOrdinal(int objectOrdinal)
531
    {
532
    RubikObject object = getObject(objectOrdinal);
533
    return object!=null ? object.getExtrasOrdinal() : -1;
534
    }
535
536 804293f0 Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
537
538
  public static int getTutorialOrdinal(int objectOrdinal)
539
    {
540
    RubikObject object = getObject(objectOrdinal);
541 fcf7320f Leszek Koltunski
    return object!=null ? object.getExtrasOrdinal() : -1;
542
    }
543
544
///////////////////////////////////////////////////////////////////////////////////////////////////
545
546
  public static int getLocalObjectMinor(int objectOrdinal)
547
    {
548
    RubikObject object = getObject(objectOrdinal);
549
    return object!=null ? object.getObjectMinor() : -1;
550
    }
551
552
///////////////////////////////////////////////////////////////////////////////////////////////////
553
554
  public static int getLocalExtrasMinor(int objectOrdinal)
555
    {
556
    RubikObject object = getObject(objectOrdinal);
557
    return object!=null ? object.getExtrasMinor() : -1;
558 804293f0 Leszek Koltunski
    }
559 a7d8c3cd Leszek Koltunski
}