Project

General

Profile

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

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

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