Revision 318c0a7d
Added by Leszek Koltunski about 3 years ago
src/main/java/org/distorted/dialogs/RubikDialogNewRecord.java | ||
---|---|---|
35 | 35 |
import android.widget.Button; |
36 | 36 |
import android.widget.TextView; |
37 | 37 |
|
38 |
import org.distorted.objectlib.main.ObjectList; |
|
39 |
|
|
40 | 38 |
import org.distorted.main.R; |
41 | 39 |
import org.distorted.main.RubikActivity; |
42 | 40 |
import org.distorted.network.RubikScores; |
src/main/java/org/distorted/dialogs/RubikDialogPattern.java | ||
---|---|---|
39 | 39 |
import android.widget.ImageView; |
40 | 40 |
import android.widget.TextView; |
41 | 41 |
|
42 |
import org.distorted.objectlib.main.ObjectList;
|
|
42 |
import org.distorted.objectlib.main.ObjectType;
|
|
43 | 43 |
|
44 | 44 |
import org.distorted.main.R; |
45 | 45 |
import org.distorted.main.RubikActivity; |
... | ... | |
104 | 104 |
|
105 | 105 |
for(int i=0; i< RubikPatternList.NUM_OBJECTS; i++) |
106 | 106 |
{ |
107 |
ObjectList list = RubikPatternList.getObject(i);
|
|
107 |
ObjectType list = RubikPatternList.getObject(i);
|
|
108 | 108 |
int iconSize = RubikActivity.getDrawableSize(); |
109 | 109 |
int iconID = list.getIconID(iconSize); |
110 | 110 |
|
src/main/java/org/distorted/dialogs/RubikDialogPatternView.java | ||
---|---|---|
26 | 26 |
import android.widget.ExpandableListView; |
27 | 27 |
import android.widget.FrameLayout; |
28 | 28 |
|
29 |
import org.distorted.objectlib.main.ObjectList;
|
|
29 |
import org.distorted.objectlib.main.ObjectType;
|
|
30 | 30 |
|
31 | 31 |
import org.distorted.main.R; |
32 | 32 |
import org.distorted.main.RubikActivity; |
... | ... | |
94 | 94 |
{ |
95 | 95 |
RubikPattern pattern = RubikPattern.getInstance(); |
96 | 96 |
int[][] moves = pattern.reInitialize(mTab, groupPosition, childPosition); |
97 |
ObjectList list = RubikPatternList.getObject(mTab);
|
|
97 |
ObjectType list = RubikPatternList.getObject(mTab);
|
|
98 | 98 |
|
99 | 99 |
ract.setupObject(list, moves); |
100 | 100 |
|
src/main/java/org/distorted/dialogs/RubikDialogScores.java | ||
---|---|---|
38 | 38 |
import android.widget.ImageView; |
39 | 39 |
import android.widget.TextView; |
40 | 40 |
|
41 |
import org.distorted.objectlib.main.ObjectList;
|
|
41 |
import org.distorted.objectlib.main.ObjectType;
|
|
42 | 42 |
|
43 | 43 |
import org.distorted.main.R; |
44 | 44 |
import org.distorted.main.RubikActivity; |
... | ... | |
104 | 104 |
tabLayout.setupWithViewPager(viewPager); |
105 | 105 |
|
106 | 106 |
viewPager.setCurrentItem(curTab); |
107 |
ObjectList list;
|
|
107 |
ObjectType list;
|
|
108 | 108 |
int iconSize = RubikActivity.getDrawableSize(); |
109 | 109 |
|
110 |
for (int object = 0; object< ObjectList.NUM_OBJECTS; object++)
|
|
110 |
for (int object = 0; object< ObjectType.NUM_OBJECTS; object++)
|
|
111 | 111 |
{ |
112 |
list = ObjectList.getObject(object);
|
|
112 |
list = ObjectType.getObject(object);
|
|
113 | 113 |
int iconID = list.getIconID(iconSize); |
114 | 114 |
ImageView imageView = new ImageView(act); |
115 | 115 |
imageView.setImageResource(iconID); |
src/main/java/org/distorted/dialogs/RubikDialogScoresPagerAdapter.java | ||
---|---|---|
30 | 30 |
import android.view.ViewGroup; |
31 | 31 |
import android.widget.LinearLayout; |
32 | 32 |
|
33 |
import org.distorted.objectlib.main.ObjectList;
|
|
33 |
import org.distorted.objectlib.main.ObjectType;
|
|
34 | 34 |
|
35 | 35 |
import org.distorted.main.R; |
36 | 36 |
import org.distorted.network.RubikScores; |
... | ... | |
117 | 117 |
|
118 | 118 |
for(int i=0; i<mNumTabs; i++) |
119 | 119 |
{ |
120 |
lastTab[i]= ObjectList.getDBLevel(i);
|
|
120 |
lastTab[i]= ObjectType.getDBLevel(i);
|
|
121 | 121 |
maxTab[i] = Math.min(lastTab[i],MAX); |
122 | 122 |
toDoTab[i]= 0; |
123 | 123 |
|
... | ... | |
208 | 208 |
{ |
209 | 209 |
mAct = act; |
210 | 210 |
mDialog = diag; |
211 |
mNumTabs = ObjectList.NUM_OBJECTS;
|
|
211 |
mNumTabs = ObjectType.NUM_OBJECTS;
|
|
212 | 212 |
mViews = new RubikDialogScoresView[mNumTabs]; |
213 | 213 |
mViewPager = viewPager; |
214 | 214 |
mIsSubmitting = isSubmitting; |
src/main/java/org/distorted/dialogs/RubikDialogScoresView.java | ||
---|---|---|
31 | 31 |
import android.widget.LinearLayout; |
32 | 32 |
import android.widget.TextView; |
33 | 33 |
|
34 |
import org.distorted.objectlib.main.ObjectList; |
|
35 |
|
|
36 | 34 |
import org.distorted.main.R; |
37 | 35 |
import org.distorted.main.RubikActivity; |
38 | 36 |
import org.distorted.network.RubikScores; |
src/main/java/org/distorted/dialogs/RubikDialogSetName.java | ||
---|---|---|
38 | 38 |
import android.widget.EditText; |
39 | 39 |
import android.widget.TextView; |
40 | 40 |
|
41 |
import org.distorted.objectlib.main.ObjectList; |
|
42 |
|
|
43 | 41 |
import org.distorted.main.R; |
44 | 42 |
import org.distorted.main.RubikActivity; |
45 | 43 |
import org.distorted.network.RubikScores; |
src/main/java/org/distorted/dialogs/RubikDialogTutorialView.java | ||
---|---|---|
35 | 35 |
|
36 | 36 |
import com.google.firebase.analytics.FirebaseAnalytics; |
37 | 37 |
|
38 |
import org.distorted.objectlib.main.ObjectList;
|
|
38 |
import org.distorted.objectlib.main.ObjectType;
|
|
39 | 39 |
|
40 | 40 |
import org.distorted.main.BuildConfig; |
41 | 41 |
import org.distorted.main.R; |
... | ... | |
76 | 76 |
String packageName = act.getPackageName(); |
77 | 77 |
|
78 | 78 |
TutorialList list = TutorialList.getObject(position); |
79 |
ObjectList objList = list.getObjectList();
|
|
79 |
ObjectType objList = list.getObjectList();
|
|
80 | 80 |
|
81 | 81 |
View tab = inflate( act, R.layout.dialog_tutorial_tab, null); |
82 | 82 |
LinearLayout layout = tab.findViewById(R.id.tabLayout); |
... | ... | |
109 | 109 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
110 | 110 |
|
111 | 111 |
private View createRow(final RubikActivity act, int countryID, final String desc, final String url, |
112 |
final String auth, int width, final ObjectList obj)
|
|
112 |
final String auth, int width, final ObjectType obj)
|
|
113 | 113 |
{ |
114 | 114 |
View row = inflate( act, R.layout.dialog_tutorial_row, null); |
115 | 115 |
Button butt = row.findViewById(R.id.tutorialButton); |
... | ... | |
149 | 149 |
|
150 | 150 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
151 | 151 |
|
152 |
private void analyticsReport(RubikActivity act, String desc, String author, ObjectList obj)
|
|
152 |
private void analyticsReport(RubikActivity act, String desc, String author, ObjectType obj)
|
|
153 | 153 |
{ |
154 | 154 |
String message = desc+" ("+author+")"; |
155 | 155 |
|
src/main/java/org/distorted/effects/scramble/ScrambleEffect.java | ||
---|---|---|
27 | 27 |
import org.distorted.library.main.DistortedScreen; |
28 | 28 |
import org.distorted.library.message.EffectListener; |
29 | 29 |
|
30 |
import org.distorted.objectlib.main.ObjectList;
|
|
30 |
import org.distorted.objectlib.main.ObjectType;
|
|
31 | 31 |
import org.distorted.objectlib.main.TwistyObject; |
32 | 32 |
|
33 | 33 |
import org.distorted.effects.BaseEffect; |
... | ... | |
89 | 89 |
ScrambleEffect() |
90 | 90 |
{ |
91 | 91 |
mRnd = new Random( System.currentTimeMillis() ); |
92 |
mScrambles = new int[ObjectList.MAX_SCRAMBLE][3];
|
|
92 |
mScrambles = new int[ObjectType.MAX_SCRAMBLE][3];
|
|
93 | 93 |
} |
94 | 94 |
|
95 | 95 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
src/main/java/org/distorted/main/RubikActivity.java | ||
---|---|---|
40 | 40 |
import org.distorted.library.type.Static4D; |
41 | 41 |
|
42 | 42 |
import org.distorted.objectlib.main.TwistyObject; |
43 |
import org.distorted.objectlib.main.ObjectList;
|
|
43 |
import org.distorted.objectlib.main.ObjectType;
|
|
44 | 44 |
|
45 | 45 |
import org.distorted.dialogs.RubikDialogError; |
46 | 46 |
import org.distorted.dialogs.RubikDialogPrivacy; |
... | ... | |
277 | 277 |
RubikScreenPlay play = (RubikScreenPlay) ScreenList.PLAY.getScreenClass(); |
278 | 278 |
int object = play.getObject(); |
279 | 279 |
|
280 |
if( object>=0 && object< ObjectList.NUM_OBJECTS )
|
|
280 |
if( object>=0 && object< ObjectType.NUM_OBJECTS )
|
|
281 | 281 |
{ |
282 | 282 |
success = true; |
283 |
ObjectList nextObj = ObjectList.values()[object];
|
|
283 |
ObjectType nextObj = ObjectType.values()[object];
|
|
284 | 284 |
view.getPreRender().changeObject(nextObj); |
285 | 285 |
} |
286 | 286 |
|
287 | 287 |
if( !success ) |
288 | 288 |
{ |
289 |
ObjectList obj = ObjectList.getObject(RubikScreenPlay.DEF_OBJECT);
|
|
289 |
ObjectType obj = ObjectType.getObject(RubikScreenPlay.DEF_OBJECT);
|
|
290 | 290 |
play.setObject(this,obj); |
291 | 291 |
view.getPreRender().changeObject(obj); |
292 | 292 |
} |
... | ... | |
457 | 457 |
|
458 | 458 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
459 | 459 |
|
460 |
public void changeObject(ObjectList newObject, boolean reportChange)
|
|
460 |
public void changeObject(ObjectType newObject, boolean reportChange)
|
|
461 | 461 |
{ |
462 | 462 |
RubikSurfaceView view = findViewById(R.id.rubikSurfaceView); |
463 | 463 |
RubikPreRender pre = view.getPreRender(); |
... | ... | |
468 | 468 |
|
469 | 469 |
if( oldObject!=null ) |
470 | 470 |
{ |
471 |
ObjectList oldList = oldObject.getObjectList();
|
|
471 |
ObjectType oldList = oldObject.getObjectList();
|
|
472 | 472 |
float fps = view.getRenderer().getFPS(); |
473 | 473 |
fps = (int)(fps+0.5f); |
474 | 474 |
StringBuilder name = new StringBuilder(); |
... | ... | |
501 | 501 |
|
502 | 502 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
503 | 503 |
|
504 |
public void setupObject(ObjectList object, int[][] moves)
|
|
504 |
public void setupObject(ObjectType object, int[][] moves)
|
|
505 | 505 |
{ |
506 | 506 |
RubikSurfaceView view = findViewById(R.id.rubikSurfaceView); |
507 | 507 |
RubikPreRender pre = view.getPreRender(); |
... | ... | |
628 | 628 |
|
629 | 629 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
630 | 630 |
|
631 |
public void switchTutorial(String url, ObjectList object)
|
|
631 |
public void switchTutorial(String url, ObjectType object)
|
|
632 | 632 |
{ |
633 | 633 |
Intent myIntent = new Intent(this, TutorialActivity.class); |
634 | 634 |
myIntent.putExtra("url", url); |
src/main/java/org/distorted/main/RubikPreRender.java | ||
---|---|---|
35 | 35 |
import com.google.firebase.analytics.FirebaseAnalytics; |
36 | 36 |
|
37 | 37 |
import org.distorted.objectlib.main.TwistyObject; |
38 |
import org.distorted.objectlib.main.ObjectList;
|
|
38 |
import org.distorted.objectlib.main.ObjectType;
|
|
39 | 39 |
|
40 | 40 |
import org.distorted.dialogs.RubikDialogNewRecord; |
41 | 41 |
import org.distorted.dialogs.RubikDialogSolved; |
... | ... | |
60 | 60 |
mInitializeObject, mSetTextureMap, mResetAllTextureMaps, mSolve; |
61 | 61 |
private boolean mUIBlocked, mTouchBlocked; |
62 | 62 |
private boolean mIsSolved; |
63 |
private ObjectList mNextObject;
|
|
63 |
private ObjectType mNextObject;
|
|
64 | 64 |
private long mRotationFinishedID; |
65 | 65 |
private final long[] mEffectID; |
66 | 66 |
private boolean mIsNewRecord; |
... | ... | |
114 | 114 |
|
115 | 115 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
116 | 116 |
|
117 |
private void createObjectNow(ObjectList object, int[][] moves)
|
|
117 |
private void createObjectNow(ObjectType object, int[][] moves)
|
|
118 | 118 |
{ |
119 | 119 |
boolean firstTime = (mNewObject==null); |
120 | 120 |
|
... | ... | |
344 | 344 |
|
345 | 345 |
int object = play.getObject(); |
346 | 346 |
int level = play.getLevel(); |
347 |
ObjectList list = ObjectList.getObject(object);
|
|
347 |
ObjectType list = ObjectType.getObject(object);
|
|
348 | 348 |
String name = scores.getName(); |
349 | 349 |
|
350 | 350 |
String record = list.name()+" level "+level+" time "+mNewRecord+" isNew: "+mIsNewRecord+" scrambleNum: "+mScrambleObjectNum; |
... | ... | |
497 | 497 |
|
498 | 498 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
499 | 499 |
|
500 |
void changeObject(ObjectList object)
|
|
500 |
void changeObject(ObjectType object)
|
|
501 | 501 |
{ |
502 | 502 |
mChangeObject = true; |
503 | 503 |
mNextObject = object; |
... | ... | |
505 | 505 |
|
506 | 506 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
507 | 507 |
|
508 |
void setupObject(ObjectList object, int[][] moves)
|
|
508 |
void setupObject(ObjectType object, int[][] moves)
|
|
509 | 509 |
{ |
510 | 510 |
mSetupObject= true; |
511 | 511 |
mNextObject = object; |
src/main/java/org/distorted/network/RubikNetwork.java | ||
---|---|---|
34 | 34 |
import androidx.fragment.app.FragmentActivity; |
35 | 35 |
|
36 | 36 |
import org.distorted.library.main.DistortedLibrary; |
37 |
import org.distorted.objectlib.main.ObjectList;
|
|
37 |
import org.distorted.objectlib.main.ObjectType;
|
|
38 | 38 |
|
39 |
import static org.distorted.objectlib.main.ObjectList.MAX_LEVEL;
|
|
40 |
import static org.distorted.objectlib.main.ObjectList.NUM_OBJECTS;
|
|
39 |
import static org.distorted.objectlib.main.ObjectType.MAX_LEVEL;
|
|
40 |
import static org.distorted.objectlib.main.ObjectType.NUM_OBJECTS;
|
|
41 | 41 |
|
42 | 42 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
43 | 43 |
|
... | ... | |
204 | 204 |
|
205 | 205 |
if( s5>s4 && s4>s3 && s3>s2 && s2>s1 && s1>0 ) |
206 | 206 |
{ |
207 |
int object = ObjectList.getOrdinal( row.substring(0,s1) );
|
|
207 |
int object = ObjectType.getOrdinal( row.substring(0,s1) );
|
|
208 | 208 |
|
209 | 209 |
if( object>=0 && object<NUM_OBJECTS ) |
210 | 210 |
{ |
... | ... | |
471 | 471 |
|
472 | 472 |
String url="https://distorted.org/magic/cgi-bin/download.cgi"; |
473 | 473 |
url += "?n="+name+"&v="+veri+"&r="+numRuns+"&p="+numPlay+"&c="+country+"&e="+mVersion+"d"; |
474 |
url += "&o="+ ObjectList.getObjectList()+"&min=0&max="+MAX_LEVEL+"&l="+MAX_PLACES;
|
|
474 |
url += "&o="+ ObjectType.getObjectList()+"&min=0&max="+MAX_LEVEL+"&l="+MAX_PLACES;
|
|
475 | 475 |
|
476 | 476 |
return url; |
477 | 477 |
} |
... | ... | |
501 | 501 |
String url1="https://distorted.org/magic/cgi-bin/submit.cgi"; |
502 | 502 |
String url2 = "n="+name+"&v="+veri+"&r="+numRuns+"&p="+numPlay+"&i="+deviceID+"&e="+mVersion+"d"; |
503 | 503 |
url2 += "&d="+renderer+"&s="+version; |
504 |
url2 += reclist+"&c="+country+"&f="+epoch+"&oo="+ ObjectList.getObjectList();
|
|
504 |
url2 += reclist+"&c="+country+"&f="+epoch+"&oo="+ ObjectType.getObjectList();
|
|
505 | 505 |
url2 += "&min=0&max="+MAX_LEVEL+"&lo="+MAX_PLACES; |
506 | 506 |
String hash = computeHash( url2, salt.getBytes() ); |
507 | 507 |
|
src/main/java/org/distorted/network/RubikScores.java | ||
---|---|---|
27 | 27 |
|
28 | 28 |
import com.google.firebase.crashlytics.FirebaseCrashlytics; |
29 | 29 |
|
30 |
import static org.distorted.objectlib.main.ObjectList.NUM_OBJECTS;
|
|
31 |
import static org.distorted.objectlib.main.ObjectList.MAX_LEVEL;
|
|
30 |
import static org.distorted.objectlib.main.ObjectType.NUM_OBJECTS;
|
|
31 |
import static org.distorted.objectlib.main.ObjectType.MAX_LEVEL;
|
|
32 | 32 |
|
33 |
import org.distorted.objectlib.main.ObjectList;
|
|
33 |
import org.distorted.objectlib.main.ObjectType;
|
|
34 | 34 |
|
35 | 35 |
import org.distorted.main.BuildConfig; |
36 | 36 |
|
... | ... | |
143 | 143 |
|
144 | 144 |
for(int object=0; object<NUM_OBJECTS; object++) |
145 | 145 |
{ |
146 |
String name = ObjectList.getObject(object).name();
|
|
146 |
String name = ObjectType.getObject(object).name();
|
|
147 | 147 |
|
148 | 148 |
for(int level=0; level<MAX_LEVEL; level++) |
149 | 149 |
{ |
... | ... | |
314 | 314 |
|
315 | 315 |
for(int object=0; object<NUM_OBJECTS; object++) |
316 | 316 |
{ |
317 |
name = ObjectList.getObject(object).name();
|
|
317 |
name = ObjectType.getObject(object).name();
|
|
318 | 318 |
builder.append(name); |
319 | 319 |
builder.append("="); |
320 | 320 |
builder.append(mRecords[object][level]); |
... | ... | |
368 | 368 |
timeStr = subStr.substring(equals+1,comma); |
369 | 369 |
submStr = subStr.substring(comma+1); |
370 | 370 |
|
371 |
object = ObjectList.getOrdinal(nameStr);
|
|
371 |
object = ObjectType.getOrdinal(nameStr);
|
|
372 | 372 |
|
373 | 373 |
if( object>=0 && object< NUM_OBJECTS ) |
374 | 374 |
{ |
src/main/java/org/distorted/patterns/RubikPatternList.java | ||
---|---|---|
19 | 19 |
|
20 | 20 |
package org.distorted.patterns; |
21 | 21 |
|
22 |
import org.distorted.objectlib.main.ObjectList;
|
|
22 |
import org.distorted.objectlib.main.ObjectType;
|
|
23 | 23 |
|
24 | 24 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
25 | 25 |
|
26 | 26 |
public enum RubikPatternList |
27 | 27 |
{ |
28 |
CUBE2 (ObjectList.CUBE_2, PatternCube2.patterns),
|
|
29 |
CUBE3 (ObjectList.CUBE_3, PatternCube3.patterns),
|
|
30 |
CUBE4 (ObjectList.CUBE_4, PatternCube4.patterns),
|
|
31 |
CUBE5 (ObjectList.CUBE_5, PatternCube5.patterns),
|
|
32 |
PYRA3 (ObjectList.PYRA_3, PatternPyraminx3.patterns),
|
|
33 |
PYRA4 (ObjectList.PYRA_4, PatternPyraminx4.patterns),
|
|
34 |
PYRA5 (ObjectList.PYRA_5, PatternPyraminx5.patterns),
|
|
35 |
MEGA3 (ObjectList.MEGA_3, PatternMegaminx.patterns),
|
|
36 |
MEGA5 (ObjectList.MEGA_5, PatternGigaminx.patterns),
|
|
28 |
CUBE2 (ObjectType.CUBE_2, PatternCube2.patterns),
|
|
29 |
CUBE3 (ObjectType.CUBE_3, PatternCube3.patterns),
|
|
30 |
CUBE4 (ObjectType.CUBE_4, PatternCube4.patterns),
|
|
31 |
CUBE5 (ObjectType.CUBE_5, PatternCube5.patterns),
|
|
32 |
PYRA3 (ObjectType.PYRA_3, PatternPyraminx3.patterns),
|
|
33 |
PYRA4 (ObjectType.PYRA_4, PatternPyraminx4.patterns),
|
|
34 |
PYRA5 (ObjectType.PYRA_5, PatternPyraminx5.patterns),
|
|
35 |
MEGA3 (ObjectType.MEGA_3, PatternMegaminx.patterns),
|
|
36 |
MEGA5 (ObjectType.MEGA_5, PatternGigaminx.patterns),
|
|
37 | 37 |
; |
38 | 38 |
|
39 | 39 |
public static final int NUM_OBJECTS = values().length; |
40 |
private final ObjectList mObject;
|
|
40 |
private final ObjectType mObject;
|
|
41 | 41 |
private final String[][] mPatterns; |
42 | 42 |
|
43 | 43 |
private static final RubikPatternList[] objects; |
... | ... | |
62 | 62 |
|
63 | 63 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
64 | 64 |
|
65 |
RubikPatternList(ObjectList object, String[][] patterns)
|
|
65 |
RubikPatternList(ObjectType object, String[][] patterns)
|
|
66 | 66 |
{ |
67 | 67 |
mObject = object; |
68 | 68 |
mPatterns = patterns; |
... | ... | |
87 | 87 |
|
88 | 88 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
89 | 89 |
|
90 |
public static ObjectList getObject(int ordinal)
|
|
90 |
public static ObjectType getObject(int ordinal)
|
|
91 | 91 |
{ |
92 | 92 |
return objects[ordinal].mObject; |
93 | 93 |
} |
src/main/java/org/distorted/screens/RubikScreenAbstract.java | ||
---|---|---|
21 | 21 |
|
22 | 22 |
import android.content.SharedPreferences; |
23 | 23 |
|
24 |
import org.distorted.objectlib.main.ObjectList; |
|
25 |
|
|
26 | 24 |
import org.distorted.main.RubikActivity; |
27 | 25 |
import org.distorted.patterns.RubikPatternList; |
28 | 26 |
import org.distorted.tutorials.TutorialList; |
src/main/java/org/distorted/screens/RubikScreenPattern.java | ||
---|---|---|
30 | 30 |
import android.widget.LinearLayout; |
31 | 31 |
import android.widget.TextView; |
32 | 32 |
|
33 |
import org.distorted.objectlib.main.ObjectList;
|
|
33 |
import org.distorted.objectlib.main.ObjectType;
|
|
34 | 34 |
|
35 | 35 |
import org.distorted.main.R; |
36 | 36 |
import org.distorted.dialogs.RubikDialogPattern; |
... | ... | |
63 | 63 |
void leaveScreen(RubikActivity act) |
64 | 64 |
{ |
65 | 65 |
RubikScreenPlay play = (RubikScreenPlay) ScreenList.PLAY.getScreenClass(); |
66 |
ObjectList object = RubikPatternList.getObject(mPatternOrdinal);
|
|
66 |
ObjectType object = RubikPatternList.getObject(mPatternOrdinal);
|
|
67 | 67 |
|
68 | 68 |
if( !play.setObject(act,object) ) |
69 | 69 |
{ |
70 | 70 |
int objectPlay= play.getObject(); |
71 | 71 |
|
72 |
act.changeObject(ObjectList.getObject(objectPlay),false);
|
|
72 |
act.changeObject(ObjectType.getObject(objectPlay),false);
|
|
73 | 73 |
} |
74 | 74 |
} |
75 | 75 |
|
src/main/java/org/distorted/screens/RubikScreenPlay.java | ||
---|---|---|
35 | 35 |
import android.widget.PopupWindow; |
36 | 36 |
import android.widget.ScrollView; |
37 | 37 |
|
38 |
import org.distorted.objectlib.main.ObjectList;
|
|
38 |
import org.distorted.objectlib.main.ObjectType;
|
|
39 | 39 |
|
40 | 40 |
import org.distorted.main.R; |
41 | 41 |
import org.distorted.main.RubikActivity; |
... | ... | |
53 | 53 |
public class RubikScreenPlay extends RubikScreenBase |
54 | 54 |
{ |
55 | 55 |
public static final int LEVELS_SHOWN = 10; |
56 |
public static final int DEF_OBJECT= ObjectList.CUBE_3.ordinal();
|
|
56 |
public static final int DEF_OBJECT= ObjectType.CUBE_3.ordinal();
|
|
57 | 57 |
|
58 | 58 |
private static final int[] BUTTON_LABELS = { R.string.scores, |
59 | 59 |
R.string.patterns, |
... | ... | |
96 | 96 |
mButtonSize = width*RubikActivity.BUTTON_TEXT_SIZE; |
97 | 97 |
mMenuItemSize = width*RubikActivity.MENU_ITEM_SIZE; |
98 | 98 |
|
99 |
mRowCount = ObjectList.getRowCount();
|
|
100 |
mColCount = ObjectList.getColumnCount();
|
|
99 |
mRowCount = ObjectType.getRowCount();
|
|
100 |
mColCount = ObjectType.getColumnCount();
|
|
101 | 101 |
|
102 | 102 |
// TOP //////////////////////////// |
103 | 103 |
LinearLayout layoutTop = act.findViewById(R.id.upperBar); |
... | ... | |
162 | 162 |
{ |
163 | 163 |
View popupView = mPlayPopup.getContentView(); |
164 | 164 |
popupView.setSystemUiVisibility(RubikActivity.FLAGS); |
165 |
final int dbLevel = ObjectList.getDBLevel(mObject);
|
|
165 |
final int dbLevel = ObjectType.getDBLevel(mObject);
|
|
166 | 166 |
final int levelsShown = Math.min(dbLevel,LEVELS_SHOWN); |
167 | 167 |
final int popupHeight = (int)(levelsShown*(mMenuItemSize+margin)+3*margin+mMenuItemSize*(LAST_BUTTON-1.0f)); |
168 | 168 |
final int realHeight = Math.min(popupHeight,maxHeight); |
... | ... | |
222 | 222 |
mObjectPopup.setContentView(objectGrid); |
223 | 223 |
} |
224 | 224 |
|
225 |
int[] indices = ObjectList.getIndices();
|
|
225 |
int[] indices = ObjectType.getIndices();
|
|
226 | 226 |
|
227 | 227 |
GridLayout.Spec[] rowSpecs = new GridLayout.Spec[mRowCount]; |
228 | 228 |
GridLayout.Spec[] colSpecs = new GridLayout.Spec[mColCount]; |
... | ... | |
242 | 242 |
colSpecs[col] = GridLayout.spec(col); |
243 | 243 |
} |
244 | 244 |
|
245 |
for(int object=0; object< ObjectList.NUM_OBJECTS; object++)
|
|
245 |
for(int object = 0; object< ObjectType.NUM_OBJECTS; object++)
|
|
246 | 246 |
{ |
247 |
final ObjectList list = ObjectList.getObject(object);
|
|
247 |
final ObjectType list = ObjectType.getObject(object);
|
|
248 | 248 |
int iconSize = RubikActivity.getDrawableSize(); |
249 | 249 |
int icons = list.getIconID(iconSize); |
250 | 250 |
final int obj = object; |
... | ... | |
430 | 430 |
public void restorePreferences(SharedPreferences preferences) |
431 | 431 |
{ |
432 | 432 |
mObject= preferences.getInt("statePlay_object", DEF_OBJECT); |
433 |
int dbLevel = ObjectList.getDBLevel(mObject);
|
|
433 |
int dbLevel = ObjectType.getDBLevel(mObject);
|
|
434 | 434 |
|
435 | 435 |
// This means the app has been upgraded to a new version which swapped the |
436 | 436 |
// Object for a new one with larger sizeIndex and now getMaxLevel() returns |
... | ... | |
441 | 441 |
|
442 | 442 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
443 | 443 |
|
444 |
public boolean setObject(RubikActivity act, ObjectList obj)
|
|
444 |
public boolean setObject(RubikActivity act, ObjectType obj)
|
|
445 | 445 |
{ |
446 | 446 |
if( mObject!=obj.ordinal() ) |
447 | 447 |
{ |
... | ... | |
494 | 494 |
|
495 | 495 |
private void adjustLevels(final RubikActivity act) |
496 | 496 |
{ |
497 |
int dbLevel = ObjectList.getDBLevel(mObject);
|
|
498 |
int numScrambles = ObjectList.getNumScramble(mObject);
|
|
497 |
int dbLevel = ObjectType.getDBLevel(mObject);
|
|
498 |
int numScrambles = ObjectType.getNumScramble(mObject);
|
|
499 | 499 |
int numLevel = Math.min(dbLevel, LEVELS_SHOWN); |
500 | 500 |
String[] levels = new String[numLevel]; |
501 | 501 |
|
src/main/java/org/distorted/screens/RubikScreenSolver.java | ||
---|---|---|
34 | 34 |
import android.widget.LinearLayout; |
35 | 35 |
|
36 | 36 |
import org.distorted.objectlib.main.TwistyObject; |
37 |
import org.distorted.objectlib.main.ObjectList;
|
|
37 |
import org.distorted.objectlib.main.ObjectType;
|
|
38 | 38 |
|
39 | 39 |
import org.distorted.dialogs.RubikDialogSolverError; |
40 | 40 |
import org.distorted.helpers.TransparentImageButton; |
... | ... | |
79 | 79 |
mWeakAct = new WeakReference<>(act); |
80 | 80 |
mSolving = false; |
81 | 81 |
|
82 |
ObjectList currentObject= ImplementedSolversList.getObject(0);
|
|
82 |
ObjectType currentObject= ImplementedSolversList.getObject(0);
|
|
83 | 83 |
|
84 | 84 |
act.setupObject(currentObject,null); |
85 | 85 |
RubikScreenPlay play = (RubikScreenPlay) ScreenList.PLAY.getScreenClass(); |
src/main/java/org/distorted/screens/RubikScreenSolving.java | ||
---|---|---|
30 | 30 |
import android.widget.LinearLayout; |
31 | 31 |
import android.widget.TextView; |
32 | 32 |
|
33 |
import org.distorted.objectlib.main.ObjectList; |
|
34 |
|
|
35 | 33 |
import org.distorted.dialogs.RubikDialogAbandon; |
36 | 34 |
import org.distorted.helpers.TransparentImageButton; |
37 | 35 |
import org.distorted.main.R; |
src/main/java/org/distorted/solvers/ImplementedSolversList.java | ||
---|---|---|
19 | 19 |
|
20 | 20 |
package org.distorted.solvers; |
21 | 21 |
|
22 |
import org.distorted.objectlib.main.ObjectList;
|
|
22 |
import org.distorted.objectlib.main.ObjectType;
|
|
23 | 23 |
|
24 | 24 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
25 | 25 |
|
26 | 26 |
public enum ImplementedSolversList |
27 | 27 |
{ |
28 |
CUBE3 ( ObjectList.CUBE_3),
|
|
28 |
CUBE3 ( ObjectType.CUBE_3),
|
|
29 | 29 |
; |
30 | 30 |
|
31 | 31 |
public static final int NUM_OBJECTS = values().length; |
32 | 32 |
|
33 |
private final ObjectList mObject;
|
|
33 |
private final ObjectType mObject;
|
|
34 | 34 |
|
35 | 35 |
private static final ImplementedSolversList[] objects; |
36 | 36 |
|
... | ... | |
47 | 47 |
|
48 | 48 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
49 | 49 |
|
50 |
public static ObjectList getObject(int ordinal)
|
|
50 |
public static ObjectType getObject(int ordinal)
|
|
51 | 51 |
{ |
52 | 52 |
return objects[ordinal].mObject; |
53 | 53 |
} |
54 | 54 |
|
55 | 55 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
56 | 56 |
|
57 |
ImplementedSolversList(ObjectList object)
|
|
57 |
ImplementedSolversList(ObjectType object)
|
|
58 | 58 |
{ |
59 | 59 |
mObject= object; |
60 | 60 |
} |
src/main/java/org/distorted/solvers/SolverMain.java | ||
---|---|---|
21 | 21 |
|
22 | 22 |
import android.content.res.Resources; |
23 | 23 |
|
24 |
import org.distorted.objectlib.main.ObjectList;
|
|
24 |
import org.distorted.objectlib.main.ObjectType;
|
|
25 | 25 |
import org.distorted.objectlib.main.TwistyObject; |
26 | 26 |
|
27 | 27 |
import org.distorted.main.R; |
... | ... | |
49 | 49 |
// If a certain cubit is locked, return the color (index into it's FACE_COLORS array) it |
50 | 50 |
// must have. Otherwise return -1. |
51 | 51 |
|
52 |
public static int cubitIsLocked(ObjectList object, int cubit)
|
|
52 |
public static int cubitIsLocked(ObjectType object, int cubit)
|
|
53 | 53 |
{ |
54 |
if( object == ObjectList.CUBE_3 )
|
|
54 |
if( object == ObjectType.CUBE_3 )
|
|
55 | 55 |
{ |
56 | 56 |
if( cubit==21 ) return 0; // center of the right face |
57 | 57 |
if( cubit== 4 ) return 1; // center of the left face |
... | ... | |
248 | 248 |
{ |
249 | 249 |
RubikScreenSolver solver = (RubikScreenSolver) ScreenList.SVER.getScreenClass(); |
250 | 250 |
|
251 |
if( mObject.getObjectList()==ObjectList.CUBE_3 )
|
|
251 |
if( mObject.getObjectList()== ObjectType.CUBE_3 )
|
|
252 | 252 |
{ |
253 | 253 |
solveCube3(solver); |
254 | 254 |
} |
src/main/java/org/distorted/tutorials/TutorialActivity.java | ||
---|---|---|
32 | 32 |
|
33 | 33 |
import org.distorted.library.main.DistortedLibrary; |
34 | 34 |
|
35 |
import org.distorted.objectlib.main.ObjectList;
|
|
35 |
import org.distorted.objectlib.main.ObjectType;
|
|
36 | 36 |
import org.distorted.objectlib.main.TwistyObject; |
37 | 37 |
|
38 | 38 |
import org.distorted.dialogs.RubikDialogError; |
... | ... | |
207 | 207 |
|
208 | 208 |
if( mWebView!=null ) mWebView.onResume(); |
209 | 209 |
|
210 |
if( mObjectOrdinal>=0 && mObjectOrdinal< ObjectList.NUM_OBJECTS )
|
|
210 |
if( mObjectOrdinal>=0 && mObjectOrdinal< ObjectType.NUM_OBJECTS )
|
|
211 | 211 |
{ |
212 |
ObjectList obj = ObjectList.getObject(mObjectOrdinal);
|
|
212 |
ObjectType obj = ObjectType.getObject(mObjectOrdinal);
|
|
213 | 213 |
view.getPreRender().changeObject(obj); |
214 | 214 |
} |
215 | 215 |
} |
src/main/java/org/distorted/tutorials/TutorialList.java | ||
---|---|---|
19 | 19 |
|
20 | 20 |
package org.distorted.tutorials; |
21 | 21 |
|
22 |
import org.distorted.objectlib.main.ObjectList;
|
|
22 |
import org.distorted.objectlib.main.ObjectType;
|
|
23 | 23 |
import org.distorted.main.RubikActivity; |
24 | 24 |
|
25 | 25 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
26 | 26 |
|
27 | 27 |
public enum TutorialList |
28 | 28 |
{ |
29 |
CUBE2 ( ObjectList.CUBE_2,
|
|
29 |
CUBE2 ( ObjectType.CUBE_2,
|
|
30 | 30 |
new String[][] { |
31 | 31 |
{"gb","rJlh5p2wAKA","How to Solve a 2x2 Rubik's Cube","Z3"}, |
32 | 32 |
{"es","f85wqJTIDlw","Resolver cubo de Rubik 2X2","Cuby"}, |
... | ... | |
39 | 39 |
} |
40 | 40 |
), |
41 | 41 |
|
42 |
CUBE3 ( ObjectList.CUBE_3,
|
|
42 |
CUBE3 ( ObjectType.CUBE_3,
|
|
43 | 43 |
new String[][] { |
44 | 44 |
{"gb","-8ohoCKN0Zw","How to Solve a Rubik's Cube","Z3"}, |
45 | 45 |
{"es","GyY0OxDk5lI","Resolver cubo de Rubik 3x3","Cuby"}, |
... | ... | |
54 | 54 |
} |
55 | 55 |
), |
56 | 56 |
|
57 |
CUBE4 ( ObjectList.CUBE_4,
|
|
57 |
CUBE4 ( ObjectType.CUBE_4,
|
|
58 | 58 |
new String[][] { |
59 | 59 |
{"gb","RR77Md71Ymc","How to Solve the 4x4 Rubik's Cube","Z3"}, |
60 | 60 |
{"es","d_4xk1r9hxU","Resolver cubo de Rubik 4x4","Cuby"}, |
... | ... | |
71 | 71 |
} |
72 | 72 |
), |
73 | 73 |
|
74 |
CUBE5 ( ObjectList.CUBE_5,
|
|
74 |
CUBE5 ( ObjectType.CUBE_5,
|
|
75 | 75 |
new String[][] { |
76 | 76 |
{"gb","zMkNkXHzQts","How to Solve the 5x5 Rubik's Cube","Z3"}, |
77 | 77 |
{"es","6uaq-xfFs98","Resolver cubo de Rubik 5x5","Cuby"}, |
... | ... | |
83 | 83 |
} |
84 | 84 |
), |
85 | 85 |
|
86 |
JING ( ObjectList.JING_2,
|
|
86 |
JING ( ObjectType.JING_2,
|
|
87 | 87 |
new String[][] { |
88 | 88 |
{"gb","0T8Iw6aI2gA","Jing's Pyraminx Tutorial","SuperAntoniovivaldi"}, |
89 | 89 |
{"es","Na27_GUIzqY","Resolver Jing Pyraminx","Cuby"}, |
... | ... | |
94 | 94 |
} |
95 | 95 |
), |
96 | 96 |
|
97 |
PYRA3 ( ObjectList.PYRA_3,
|
|
97 |
PYRA3 ( ObjectType.PYRA_3,
|
|
98 | 98 |
new String[][] { |
99 | 99 |
{"gb","xIQtn2qazvg","Pyraminx Layer By Layer","Z3"}, |
100 | 100 |
{"es","4cJJe9RAzAU","Resolver Pyraminx","Cuby"}, |
... | ... | |
107 | 107 |
} |
108 | 108 |
), |
109 | 109 |
|
110 |
PYRA4 ( ObjectList.PYRA_4,
|
|
110 |
PYRA4 ( ObjectType.PYRA_4,
|
|
111 | 111 |
new String[][] { |
112 | 112 |
{"gb","tGQDqDcSa6U","How to Solve the Master Pyraminx","Z3"}, |
113 | 113 |
{"es","74PIPm9-uPg","Resolver Master Pyraminx 4x4","Cuby"}, |
... | ... | |
119 | 119 |
} |
120 | 120 |
), |
121 | 121 |
|
122 |
PYRA5 ( ObjectList.PYRA_5,
|
|
122 |
PYRA5 ( ObjectType.PYRA_5,
|
|
123 | 123 |
new String[][] { |
124 | 124 |
{"gb","2nsPEECDdN0","Professor Pyraminx Solve","RedKB"}, |
125 | 125 |
{"es","cSDj8OQK3TU","Tutorial del Professor Pyraminx","QBAndo"}, |
... | ... | |
129 | 129 |
} |
130 | 130 |
), |
131 | 131 |
|
132 |
KILO3( ObjectList.KILO_3,
|
|
132 |
KILO3( ObjectType.KILO_3,
|
|
133 | 133 |
new String[][] { |
134 | 134 |
{"gb","grgGgUSxiQg","How to Solve the Kilominx","Z3"}, |
135 | 135 |
{"es","g6WMYjkCLok","Resolver Kilominx","Cuby"}, |
... | ... | |
141 | 141 |
} |
142 | 142 |
), |
143 | 143 |
|
144 |
KILO5( ObjectList.KILO_5,
|
|
144 |
KILO5( ObjectType.KILO_5,
|
|
145 | 145 |
new String[][] { |
146 | 146 |
{"gb","VAnzC2SYVc4","How To Solve A Master Kilominx","Grizz Media"}, |
147 | 147 |
{"es","ozINTg-61Fs","Tutorial Master Kilominx","RubikArt"}, |
... | ... | |
156 | 156 |
} |
157 | 157 |
), |
158 | 158 |
|
159 |
MEGA3( ObjectList.MEGA_3,
|
|
159 |
MEGA3( ObjectType.MEGA_3,
|
|
160 | 160 |
new String[][] { |
161 | 161 |
{"gb","j4x61L5Onzk","How to Solve the Megaminx","Z3"}, |
162 | 162 |
{"es","xuKbT6Il0Ko","Resolver Megaminx","Cuby"}, |
... | ... | |
168 | 168 |
} |
169 | 169 |
), |
170 | 170 |
|
171 |
MEGA5( ObjectList.MEGA_5,
|
|
171 |
MEGA5( ObjectType.MEGA_5,
|
|
172 | 172 |
new String[][] { |
173 | 173 |
{"gb","MNBMm8BnHtQ","Solve the Gigaminx Part 1","BeardedCubing"}, |
174 | 174 |
{"gb","QrrP4GwqVMw","Solve the Gigaminx Part 2","BeardedCubing"}, |
... | ... | |
186 | 186 |
} |
187 | 187 |
), |
188 | 188 |
|
189 |
ULTI ( ObjectList.ULTI_2,
|
|
189 |
ULTI ( ObjectType.ULTI_2,
|
|
190 | 190 |
new String[][] { |
191 | 191 |
{"gb","n1ikPKZxGEo","Ultimate Skewb Tutorial","BeardedCubing"}, |
192 | 192 |
{"es","wNL1WJ_sCfs","Resolver Skewb ULTIMATE","Cuby"}, |
... | ... | |
198 | 198 |
} |
199 | 199 |
), |
200 | 200 |
|
201 |
DIAM2 ( ObjectList.DIAM_2,
|
|
201 |
DIAM2 ( ObjectType.DIAM_2,
|
|
202 | 202 |
new String[][] { |
203 | 203 |
{"gb","R2wrbJJ3izM","How to Solve a Skewb Diamond","Dr. Penguin^3"}, |
204 | 204 |
{"es","2RCusYQdYYE","Como resolver Skewb Diamond","Tutoriales Rubik"}, |
... | ... | |
210 | 210 |
} |
211 | 211 |
), |
212 | 212 |
|
213 |
DIAM3 ( ObjectList.DIAM_3,
|
|
213 |
DIAM3 ( ObjectType.DIAM_3,
|
|
214 | 214 |
new String[][] { |
215 | 215 |
{"gb","n_mBSUDLUZw","Face Turning Octahedron Tutorial","SuperAntoniovivaldi"}, |
216 | 216 |
{"es","ogf0t6fGxZI","FTO - Tutorial en español","Gadi Rubik"}, |
... | ... | |
220 | 220 |
} |
221 | 221 |
), |
222 | 222 |
|
223 |
DIAM4 ( ObjectList.DIAM_4,
|
|
223 |
DIAM4 ( ObjectType.DIAM_4,
|
|
224 | 224 |
new String[][] { |
225 | 225 |
{"gb","3GJkySk5zeQ","Master Face Turning Octahedron","SuperAntoniovivaldi"}, |
226 | 226 |
{"gb","zW_1htxy52k","Master FTO Tutorial","Michele Regano"}, |
... | ... | |
229 | 229 |
} |
230 | 230 |
), |
231 | 231 |
|
232 |
DINO3 ( ObjectList.DINO_3,
|
|
232 |
DINO3 ( ObjectType.DINO_3,
|
|
233 | 233 |
new String[][] { |
234 | 234 |
{"gb","puTJZqFBQwo","Dino Skewb Cube Tutorial","Bearded Cubing"}, |
235 | 235 |
{"es","6o1Yo5iCxvI","Resolver Cubo Dino","Cuby"}, |
... | ... | |
241 | 241 |
} |
242 | 242 |
), |
243 | 243 |
|
244 |
REDI3 ( ObjectList.REDI_3,
|
|
244 |
REDI3 ( ObjectType.REDI_3,
|
|
245 | 245 |
new String[][] { |
246 | 246 |
{"gb","Qn7TJED6O-4","How to Solve the MoYu Redi Cube","Z3"}, |
247 | 247 |
{"es","g0M38Aotgac","Resolver Redi Cube","Cuby"}, |
... | ... | |
253 | 253 |
} |
254 | 254 |
), |
255 | 255 |
|
256 |
HELI3 ( ObjectList.HELI_3,
|
|
256 |
HELI3 ( ObjectType.HELI_3,
|
|
257 | 257 |
new String[][] { |
258 | 258 |
{"gb","-suwJpd_PO8","Helicopter Cube Tutorial","Bearded Cubing"}, |
259 | 259 |
{"es","DWG9n_YyGPA","Resolver Helicopter Cube","Cuby"}, |
... | ... | |
265 | 265 |
} |
266 | 266 |
), |
267 | 267 |
|
268 |
SKEW2 ( ObjectList.SKEW_2,
|
|
268 |
SKEW2 ( ObjectType.SKEW_2,
|
|
269 | 269 |
new String[][] { |
270 | 270 |
{"gb","I6132yshkeU","How to Solve the Skewb","Z3"}, |
271 | 271 |
{"es","wxQX3HhPgds","Resolver Skewb (Principiantes)","Cuby"}, |
... | ... | |
278 | 278 |
} |
279 | 279 |
), |
280 | 280 |
|
281 |
SKEW3 ( ObjectList.SKEW_3,
|
|
281 |
SKEW3 ( ObjectType.SKEW_3,
|
|
282 | 282 |
new String[][] { |
283 | 283 |
{"gb","Jiuf7zQyPYI","Master Skewb Cube Tutorial","Bearded Cubing"}, |
284 | 284 |
{"es","8TP6p63KQCA","Master Skewb en Español","jorlozCubes"}, |
... | ... | |
293 | 293 |
} |
294 | 294 |
), |
295 | 295 |
|
296 |
IVY2 ( ObjectList.IVY_2,
|
|
296 |
IVY2 ( ObjectType.IVY_2,
|
|
297 | 297 |
new String[][] { |
298 | 298 |
{"gb","QMzeJobSu1M","How to Solve the Ivy Cube","Z3"}, |
299 | 299 |
{"es","2-Gf2cmEJDs","Resolver Ivy Cube","Cuby"}, |
... | ... | |
305 | 305 |
} |
306 | 306 |
), |
307 | 307 |
|
308 |
REX3 ( ObjectList.REX_3,
|
|
308 |
REX3 ( ObjectType.REX_3,
|
|
309 | 309 |
new String[][] { |
310 | 310 |
{"gb","noAQfWqlMbk","Rex Cube Tutorial","CrazyBadCuber"}, |
311 | 311 |
{"es","Q90x9rjLJzw","Resolver Cubo Rex","Cuby"}, |
... | ... | |
317 | 317 |
} |
318 | 318 |
), |
319 | 319 |
|
320 |
BAN1( ObjectList.BAN1_3,
|
|
320 |
BAN1( ObjectType.BAN1_3,
|
|
321 | 321 |
new String[][] { |
322 | 322 |
{"gb","F_iJk_IvpVo","Bandaged Cube","CanChrisSolve"}, |
323 | 323 |
{"es","_lTgw5aEFOg","Tutorial 3x3 Fuse Cube","QBAndo"}, |
... | ... | |
328 | 328 |
} |
329 | 329 |
), |
330 | 330 |
|
331 |
BAN2( ObjectList.BAN2_3,
|
|
331 |
BAN2( ObjectType.BAN2_3,
|
|
332 | 332 |
new String[][] { |
333 | 333 |
{"ru","lS_EK0PMWI8","Как собрать 2-bar Cube","Алексей Ярыгин"}, |
334 | 334 |
{"pl","tX8ubTLh6p8","Bandaged 3x3 (Two bar)","MrUK"}, |
... | ... | |
336 | 336 |
} |
337 | 337 |
), |
338 | 338 |
|
339 |
BAN3( ObjectList.BAN3_3,
|
|
339 |
BAN3( ObjectType.BAN3_3,
|
|
340 | 340 |
new String[][] { |
341 | 341 |
{"gb","7UiCVGygUT4","Bandage Cube C Tutorial","PolyakB"}, |
342 | 342 |
{"ru","gXenRA92Wdc","Как собрать Bandaged 3x3 Type C","YG Cuber"}, |
... | ... | |
345 | 345 |
} |
346 | 346 |
), |
347 | 347 |
|
348 |
BAN4( ObjectList.BAN4_3,
|
|
348 |
BAN4( ObjectType.BAN4_3,
|
|
349 | 349 |
new String[][] { |
350 | 350 |
{"gb","AnpdIKICBpM","Trying to Solve a Bandaged Cube","RedKB"}, |
351 | 351 |
{"es","cUyo5fycrvI","Tutorial Bandaged Cube en español","Rafa Garcia Benacazon"}, |
... | ... | |
357 | 357 |
} |
358 | 358 |
), |
359 | 359 |
|
360 |
SQUA1 ( ObjectList.SQU1_3,
|
|
360 |
SQUA1 ( ObjectType.SQU1_3,
|
|
361 | 361 |
new String[][] { |
362 | 362 |
{"gb","0tX-f6RLgac","How to Solve the Square-1","Z3"}, |
363 | 363 |
{"es","mGtHDWj_i1o","Resolver SQUARE-1","Cuby"}, |
... | ... | |
372 | 372 |
} |
373 | 373 |
), |
374 | 374 |
|
375 |
SQUA2 ( ObjectList.SQU2_3,
|
|
375 |
SQUA2 ( ObjectType.SQU2_3,
|
|
376 | 376 |
new String[][] { |
377 | 377 |
{"gb","PPXojiFthEs","Square-2 Tutorial","SuperAntoniovivaldi"}, |
378 | 378 |
{"es","IiMwc51xKBQ","Cómo resolver Square-2","skieur cubb"}, |
... | ... | |
383 | 383 |
} |
384 | 384 |
), |
385 | 385 |
|
386 |
MIRR2 ( ObjectList.MIRR_2,
|
|
386 |
MIRR2 ( ObjectType.MIRR_2,
|
|
387 | 387 |
new String[][] { |
388 | 388 |
{"gb","rSH-ZEqTmxs","Solve 2x2 Mirror Blocks","King of Cubing"}, |
389 | 389 |
{"es","Ipz-Ajpd4Fg","Como resolver el mirror 2x2","RUBI CUBI"}, |
... | ... | |
394 | 394 |
} |
395 | 395 |
), |
396 | 396 |
|
397 |
MIRR3 ( ObjectList.MIRR_3,
|
|
397 |
MIRR3 ( ObjectType.MIRR_3,
|
|
398 | 398 |
new String[][] { |
399 | 399 |
{"gb","YkzXIWnqbSw","How to Solve the Mirror Cube","Z3"}, |
400 | 400 |
{"es","ZTkunMo51l0","Resolver cubo de Rubik MIRROR","Cuby"}, |
... | ... | |
408 | 408 |
|
409 | 409 |
|
410 | 410 |
public static final int NUM_OBJECTS = values().length; |
411 |
private final ObjectList mObject;
|
|
411 |
private final ObjectType mObject;
|
|
412 | 412 |
private final String[][] mTutorials; |
413 | 413 |
private final int mNumTutorials; |
414 | 414 |
|
... | ... | |
427 | 427 |
|
428 | 428 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
429 | 429 |
|
430 |
TutorialList(ObjectList object, String[][] tutorials)
|
|
430 |
TutorialList(ObjectType object, String[][] tutorials)
|
|
431 | 431 |
{ |
432 | 432 |
mObject = object; |
433 | 433 |
mTutorials = tutorials; |
... | ... | |
445 | 445 |
|
446 | 446 |
public static int getOrdinal(int object) |
447 | 447 |
{ |
448 |
if( object==ObjectList.DIN4_3.ordinal() )
|
|
448 |
if( object== ObjectType.DIN4_3.ordinal() )
|
|
449 | 449 |
{ |
450 |
object= ObjectList.DINO_3.ordinal();
|
|
450 |
object= ObjectType.DINO_3.ordinal();
|
|
451 | 451 |
} |
452 | 452 |
|
453 | 453 |
for(int i=0; i<NUM_OBJECTS; i++) |
... | ... | |
463 | 463 |
|
464 | 464 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
465 | 465 |
|
466 |
public ObjectList getObjectList()
|
|
466 |
public ObjectType getObjectList()
|
|
467 | 467 |
{ |
468 | 468 |
return mObject; |
469 | 469 |
} |
src/main/java/org/distorted/tutorials/TutorialPreRender.java | ||
---|---|---|
22 | 22 |
import android.content.Context; |
23 | 23 |
import android.content.res.Resources; |
24 | 24 |
|
25 |
import org.distorted.objectlib.main.ObjectList;
|
|
25 |
import org.distorted.objectlib.main.ObjectType;
|
|
26 | 26 |
import org.distorted.objectlib.main.TwistyObject; |
27 | 27 |
|
28 | 28 |
import org.distorted.effects.BaseEffect; |
... | ... | |
42 | 42 |
mInitializeObject, mResetAllTextureMaps, mRemovePatternRotation, mSolve; |
43 | 43 |
private boolean mUIBlocked, mTouchBlocked; |
44 | 44 |
private boolean mIsSolved; |
45 |
private ObjectList mNextObject;
|
|
45 |
private ObjectType mNextObject;
|
|
46 | 46 |
private long mRotationFinishedID; |
47 | 47 |
private int mScreenWidth; |
48 | 48 |
private TwistyObject mOldObject, mNewObject; |
... | ... | |
84 | 84 |
|
85 | 85 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
86 | 86 |
|
87 |
private void createObjectNow(ObjectList object)
|
|
87 |
private void createObjectNow(ObjectType object)
|
|
88 | 88 |
{ |
89 | 89 |
if( mOldObject!=null ) mOldObject.releaseResources(); |
90 | 90 |
mOldObject = mNewObject; |
... | ... | |
291 | 291 |
|
292 | 292 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
293 | 293 |
|
294 |
void changeObject(ObjectList object)
|
|
294 |
void changeObject(ObjectType object)
|
|
295 | 295 |
{ |
296 | 296 |
mChangeObject = true; |
297 | 297 |
mNextObject = object; |
src/main/java/org/distorted/tutorials/TutorialState.java | ||
---|---|---|
23 | 23 |
import android.widget.ImageButton; |
24 | 24 |
import android.widget.LinearLayout; |
25 | 25 |
|
26 |
import org.distorted.objectlib.main.ObjectList;
|
|
26 |
import org.distorted.objectlib.main.ObjectType;
|
|
27 | 27 |
|
28 | 28 |
import org.distorted.helpers.MovesAndLockController; |
29 | 29 |
import org.distorted.helpers.TwistyActivity; |
... | ... | |
72 | 72 |
public void onClick(View v) |
73 | 73 |
{ |
74 | 74 |
RubikScreenPlay play = (RubikScreenPlay) ScreenList.PLAY.getScreenClass(); |
75 |
int numScrambles = ObjectList.getNumScramble(play.getObject());
|
|
75 |
int numScrambles = ObjectType.getNumScramble(play.getObject());
|
|
76 | 76 |
act.getPreRender().scrambleObject(numScrambles); |
77 | 77 |
} |
78 | 78 |
}); |
Also available in: Unified diff
Reename ObjectList to a more logical ObjectType.