16 |
16 |
import android.content.SharedPreferences;
|
17 |
17 |
|
18 |
18 |
import org.distorted.external.RubikFiles;
|
19 |
|
import org.distorted.external.RubikScores;
|
|
19 |
//import org.distorted.external.RubikScores;
|
20 |
20 |
import org.distorted.main.RubikActivity;
|
21 |
21 |
import org.distorted.objectlib.main.ObjectSignatures;
|
22 |
22 |
import org.distorted.objectlib.main.ObjectType;
|
... | ... | |
24 |
24 |
import static org.distorted.objectlib.main.TwistyObject.MESH_NICE;
|
25 |
25 |
import static org.distorted.objectlib.main.ObjectType.NUM_OBJECTS;
|
26 |
26 |
import static org.distorted.main.RubikActivity.SHOW_DOWNLOADED_DEBUG;
|
27 |
|
import static org.distorted.main.RubikActivity.SHOW_SOLVED_DEBUG;
|
|
27 |
//import static org.distorted.main.RubikActivity.SHOW_SOLVED_DEBUG;
|
28 |
28 |
import static org.distorted.screens.RubikScreenPlay.LEVELS_SHOWN;
|
29 |
29 |
|
30 |
30 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
... | ... | |
60 |
60 |
}
|
61 |
61 |
|
62 |
62 |
private static ArrayList<DownloadedObject> mDownloadedObjects;
|
|
63 |
/*
|
63 |
64 |
private static String mFreeSolvedObjects;
|
64 |
65 |
private static String mFreeBoughtObjects;
|
65 |
66 |
private static int mNumFreeSolved;
|
66 |
|
|
|
67 |
*/
|
67 |
68 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
68 |
69 |
|
69 |
70 |
private RubikObjectList()
|
70 |
71 |
{
|
71 |
72 |
mNumObjects = 0;
|
72 |
73 |
mNumExtras = 0;
|
73 |
|
mNumFreeSolved = 0;
|
|
74 |
//mNumFreeSolved = 0;
|
74 |
75 |
|
75 |
76 |
mObjects = new ArrayList<>();
|
76 |
77 |
mDownloadedObjects = new ArrayList<>();
|
... | ... | |
120 |
121 |
RubikObject obj = new RubikObject(object);
|
121 |
122 |
mObjects.add(obj);
|
122 |
123 |
mNumObjects++;
|
123 |
|
|
|
124 |
/*
|
124 |
125 |
int numUnclaimed = getNumUnclaimedSolves();
|
125 |
126 |
|
126 |
127 |
if( numUnclaimed>0 && !obj.isFree() )
|
... | ... | |
129 |
130 |
if( SHOW_SOLVED_DEBUG ) android.util.Log.e("D", "downloadedObject: "+objname+" making it solved. Unclaimed: "+numUnclaimed);
|
130 |
131 |
solveObject(obj,objname);
|
131 |
132 |
}
|
132 |
|
|
|
133 |
*/
|
133 |
134 |
if( SHOW_DOWNLOADED_DEBUG ) android.util.Log.e("D", "creating downloaded object "+obj.getUpperName() );
|
134 |
135 |
|
135 |
136 |
if( obj.hasExtras() )
|
... | ... | |
155 |
156 |
}
|
156 |
157 |
|
157 |
158 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
158 |
|
|
|
159 |
/*
|
159 |
160 |
private static void restoreFreedObjects(SharedPreferences preferences)
|
160 |
161 |
{
|
161 |
162 |
mFreeSolvedObjects = preferences.getString("rol_freeSolved", "");
|
... | ... | |
268 |
269 |
|
269 |
270 |
return false;
|
270 |
271 |
}
|
271 |
|
|
|
272 |
*/
|
272 |
273 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
273 |
274 |
// PUBLIC API
|
274 |
275 |
|
... | ... | |
357 |
358 |
}
|
358 |
359 |
}
|
359 |
360 |
}
|
360 |
|
|
|
361 |
/*
|
361 |
362 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
362 |
363 |
|
363 |
364 |
public static boolean allAlreadyBought()
|
... | ... | |
425 |
426 |
RubikObject object = getObject(shortName);
|
426 |
427 |
return solveObject(object,shortName);
|
427 |
428 |
}
|
428 |
|
|
|
429 |
*/
|
429 |
430 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
430 |
431 |
|
431 |
432 |
public static void savePreferences(SharedPreferences.Editor editor)
|
... | ... | |
469 |
470 |
{
|
470 |
471 |
editor.putString("rol_downloaded", "" );
|
471 |
472 |
}
|
472 |
|
|
|
473 |
/*
|
473 |
474 |
editor.putString("rol_freeSolved", mFreeSolvedObjects);
|
474 |
475 |
editor.putString("rol_freeBought", mFreeBoughtObjects);
|
475 |
476 |
|
... | ... | |
478 |
479 |
android.util.Log.e("D", "saving solved objects: "+mFreeSolvedObjects);
|
479 |
480 |
android.util.Log.e("D", "saving bought objects: "+mFreeBoughtObjects);
|
480 |
481 |
}
|
|
482 |
*/
|
481 |
483 |
}
|
482 |
484 |
|
483 |
485 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
... | ... | |
529 |
531 |
mObject = getOrdinal(objName);
|
530 |
532 |
if( mObject<0 || mObject>=mNumObjects ) mObject = DEF_OBJECT;
|
531 |
533 |
|
532 |
|
if( justStarted) restoreFreedObjects(preferences);
|
|
534 |
// if( justStarted) restoreFreedObjects(preferences);
|
533 |
535 |
}
|
534 |
536 |
|
535 |
537 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
... | ... | |
550 |
552 |
}
|
551 |
553 |
|
552 |
554 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
553 |
|
|
|
555 |
/*
|
554 |
556 |
public static void setObjectFreeState()
|
555 |
557 |
{
|
556 |
558 |
int numUnclaimed = getNumUnclaimedSolves();
|
... | ... | |
562 |
564 |
if( stillUnclaimed>0) markAsFree(stillUnclaimed);
|
563 |
565 |
}
|
564 |
566 |
}
|
565 |
|
|
|
567 |
*/
|
566 |
568 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
567 |
569 |
|
568 |
570 |
public static boolean setCurrObject(int ordinal)
|
Switch off marking objects as free and bought in RubikObjectList
Up compileSdkVerion to 32 (dependency forces us to do so)