Revision d8cf6f49
Added by Leszek Koltunski almost 2 years ago
src/main/java/org/distorted/screens/RubikScreenSolver.java | ||
---|---|---|
24 | 24 |
import android.widget.LinearLayout; |
25 | 25 |
|
26 | 26 |
import org.distorted.objectlib.main.ObjectControl; |
27 |
import org.distorted.objectlib.main.ObjectSignatures; |
|
27 | 28 |
import org.distorted.objectlib.main.TwistyObject; |
28 | 29 |
|
29 | 30 |
import org.distorted.dialogs.RubikDialogSolverError; |
30 | 31 |
import org.distorted.helpers.TransparentImageButton; |
31 | 32 |
import org.distorted.main.R; |
32 | 33 |
import org.distorted.main.RubikActivity; |
34 |
import org.distorted.objectlib.shape.ShapeDiamond; |
|
35 |
import org.distorted.objectlib.shape.ShapeDodecahedron; |
|
36 |
import org.distorted.objectlib.shape.ShapeHexahedron; |
|
37 |
import org.distorted.objectlib.shape.ShapeOctahedron; |
|
38 |
import org.distorted.objectlib.shape.ShapeTetrahedron; |
|
33 | 39 |
import org.distorted.objects.RubikObjectList; |
34 | 40 |
import org.distorted.solvers.ImplementedSolversList; |
35 | 41 |
import org.distorted.solvers.SolverMain; |
... | ... | |
80 | 86 |
control.solveOnly(); |
81 | 87 |
RubikObjectList.setCurrObject(currentObject); |
82 | 88 |
|
83 |
generateFaceColors(); |
|
89 |
generateFaceColors(currentObject);
|
|
84 | 90 |
|
85 | 91 |
// TOP //////////////////////////// |
86 | 92 |
LinearLayout layoutTop = act.findViewById(R.id.upperBar); |
... | ... | |
120 | 126 |
} |
121 | 127 |
|
122 | 128 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
129 |
// This doesn't quite work in many cases, but in case of the solvers that will pop up in foreseeable |
|
130 |
// future it should be ok. |
|
123 | 131 |
|
124 |
public void generateFaceColors() |
|
132 |
public void generateFaceColors(int object)
|
|
125 | 133 |
{ |
126 |
mFaceColors= new int[] { TwistyObject.COLOR_YELLOW, |
|
127 |
TwistyObject.COLOR_WHITE, |
|
128 |
TwistyObject.COLOR_BLUE , |
|
129 |
TwistyObject.COLOR_GREEN, |
|
130 |
TwistyObject.COLOR_RED , |
|
131 |
TwistyObject.COLOR_ORANGE }; |
|
132 |
mNumFaces = 6; |
|
134 |
if( object== ObjectSignatures.PYRA_3 || |
|
135 |
object== ObjectSignatures.PYRA_4 || |
|
136 |
object== ObjectSignatures.PYRA_5 || |
|
137 |
object== ObjectSignatures.PDUO_2 || |
|
138 |
object== ObjectSignatures.JING_2 || |
|
139 |
object== ObjectSignatures.MORP_2 || |
|
140 |
object== ObjectSignatures.MORP_3 || |
|
141 |
object== ObjectSignatures.MORP_4 ) |
|
142 |
{ |
|
143 |
mNumFaces = ShapeTetrahedron.NUM_FACES; |
|
144 |
mFaceColors = ShapeTetrahedron.FACE_COLORS; |
|
145 |
} |
|
146 |
else if( object== ObjectSignatures.DIAM_2 || |
|
147 |
object== ObjectSignatures.DIAM_3 || |
|
148 |
object== ObjectSignatures.DIAM_4 || |
|
149 |
object== ObjectSignatures.TRAJ_3 || |
|
150 |
object== ObjectSignatures.TRAJ_4 || |
|
151 |
object== ObjectSignatures.PDIA_3 ) |
|
152 |
{ |
|
153 |
mNumFaces = ShapeOctahedron.NUM_FACES; |
|
154 |
mFaceColors = ShapeOctahedron.FACE_COLORS; |
|
155 |
} |
|
156 |
else if( object== ObjectSignatures.CRYS_3 || |
|
157 |
object== ObjectSignatures.STAR_3 || |
|
158 |
object== ObjectSignatures.PENT_2 || |
|
159 |
object== ObjectSignatures.KILO_3 || |
|
160 |
object== ObjectSignatures.KILO_5 || |
|
161 |
object== ObjectSignatures.MEGA_3 || |
|
162 |
object== ObjectSignatures.MEGA_5 ) |
|
163 |
{ |
|
164 |
mNumFaces = ShapeDodecahedron.NUM_FACES; |
|
165 |
mFaceColors = ShapeDodecahedron.FACE_COLORS; |
|
166 |
} |
|
167 |
else if( object== ObjectSignatures.BALL_4 ) |
|
168 |
{ |
|
169 |
mNumFaces = ShapeDiamond.NUM_FACES; |
|
170 |
mFaceColors = ShapeDiamond.FACE_COLORS; |
|
171 |
} |
|
172 |
else |
|
173 |
{ |
|
174 |
mNumFaces = ShapeHexahedron.NUM_FACES; |
|
175 |
mFaceColors = ShapeHexahedron.FACE_COLORS; |
|
176 |
} |
|
133 | 177 |
} |
134 | 178 |
|
135 | 179 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Progress with SolverScreen.