Revision bbc6471c
Added by Leszek Koltunski about 3 years ago
src/main/java/org/distorted/objects/TwistyDino.java | ||
---|---|---|
32 | 32 |
import org.distorted.library.type.Static4D; |
33 | 33 |
import org.distorted.main.RubikSurfaceView; |
34 | 34 |
|
35 |
import java.util.Random; |
|
36 |
|
|
37 |
import static org.distorted.effects.scramble.ScrambleEffect.START_AXIS; |
|
38 |
|
|
39 | 35 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
40 | 36 |
|
41 | 37 |
public abstract class TwistyDino extends TwistyObject |
... | ... | |
250 | 246 |
return 3; |
251 | 247 |
} |
252 | 248 |
|
253 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
254 |
|
|
255 |
public int randomizeNewRotAxis(Random rnd, int oldRotAxis) |
|
256 |
{ |
|
257 |
int numAxis = ROTATION_AXIS.length; |
|
258 |
|
|
259 |
if( oldRotAxis == START_AXIS ) |
|
260 |
{ |
|
261 |
return rnd.nextInt(numAxis); |
|
262 |
} |
|
263 |
else |
|
264 |
{ |
|
265 |
int newVector = rnd.nextInt(numAxis-1); |
|
266 |
return (newVector>=oldRotAxis ? newVector+1 : newVector); |
|
267 |
} |
|
268 |
} |
|
269 |
|
|
270 | 249 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
271 | 250 |
// only needed for solvers - there are no Dino solvers ATM) |
272 | 251 |
|
Also available in: Unified diff
Change the automatic scramble API in the TwistyObject - in preparation for automatic scrambles in the Bandaged Objects.