Revision 27a70eae
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/magic/RubikActivity.java | ||
---|---|---|
32 | 32 |
import org.distorted.library.main.DistortedLibrary; |
33 | 33 |
|
34 | 34 |
import org.distorted.network.RubikScoresDownloader; |
35 |
import org.distorted.object.RubikObject; |
|
35 |
import org.distorted.object.RubikObjectList;
|
|
36 | 36 |
import org.distorted.uistate.RubikState; |
37 | 37 |
import org.distorted.uistate.RubikStateAbstract; |
38 | 38 |
import org.distorted.uistate.RubikStatePlay; |
... | ... | |
72 | 72 |
view.onResume(); |
73 | 73 |
restorePreferences(); |
74 | 74 |
RubikState.setState(this); |
75 |
RubikStatePlay play = (RubikStatePlay)RubikState.PLAY.getStateClass(); |
|
76 |
int ordinal = play.getButton(); |
|
77 |
view.getRenderer().createObject(RubikObjectList.getObject(ordinal)); |
|
75 | 78 |
} |
76 | 79 |
|
77 | 80 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
90 | 93 |
{ |
91 | 94 |
int id = v.getId(); |
92 | 95 |
|
93 |
if( id>=0 && id< RubikObject.LENGTH ) |
|
96 |
if( id>=0 && id< RubikObjectList.LENGTH )
|
|
94 | 97 |
{ |
95 |
int size = RubikObject.getObject(id).getObjectSize();
|
|
98 |
RubikObjectList object = RubikObjectList.getObject(id);
|
|
96 | 99 |
|
97 | 100 |
RubikSurfaceView view = findViewById(R.id.rubikSurfaceView); |
98 |
boolean success = view.getRenderer().createCube(size);
|
|
101 |
boolean success = view.getRenderer().createObject(object);
|
|
99 | 102 |
|
100 | 103 |
if( success ) |
101 | 104 |
{ |
... | ... | |
203 | 206 |
RubikSurfaceView view = findViewById(R.id.rubikSurfaceView); |
204 | 207 |
RubikStatePlay play = (RubikStatePlay)RubikState.PLAY.getStateClass(); |
205 | 208 |
int scramble = play.getPicker(); |
206 |
view.getRenderer().scrambleCube(scramble);
|
|
209 |
view.getRenderer().scrambleObject(scramble);
|
|
207 | 210 |
} |
208 | 211 |
|
209 | 212 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
211 | 214 |
public void Solve(View v) |
212 | 215 |
{ |
213 | 216 |
RubikSurfaceView view = findViewById(R.id.rubikSurfaceView); |
214 |
view.getRenderer().solveCube();
|
|
217 |
view.getRenderer().solveObject();
|
|
215 | 218 |
} |
216 | 219 |
} |
Also available in: Unified diff
Make RubikCube and RubikCubeMovement generic and not visible outside of their package.