Revision 55e6be1d
Added by Leszek Koltunski almost 3 years ago
src/main/java/org/distorted/main/RubikPreRender.java | ||
---|---|---|
39 | 39 |
import org.distorted.effects.BaseEffect; |
40 | 40 |
import org.distorted.effects.EffectController; |
41 | 41 |
import org.distorted.effects.scramble.ScrambleEffect; |
42 |
import org.distorted.helpers.MovesFinished; |
|
43 |
import org.distorted.helpers.TwistyPreRender; |
|
42 | 44 |
import org.distorted.objects.TwistyObject; |
43 | 45 |
import org.distorted.objects.ObjectList; |
44 | 46 |
import org.distorted.network.RubikScores; |
... | ... | |
48 | 50 |
|
49 | 51 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
50 | 52 |
|
51 |
public class RubikPreRender implements EffectController |
|
53 |
public class RubikPreRender implements EffectController, TwistyPreRender
|
|
52 | 54 |
{ |
53 |
public interface ActionFinishedListener |
|
54 |
{ |
|
55 |
void onActionFinished(long effectID); |
|
56 |
} |
|
57 |
|
|
58 | 55 |
private final RubikSurfaceView mView; |
59 | 56 |
private boolean mFinishRotation, mRemoveRotation, mRemovePatternRotation, mAddRotation, |
60 | 57 |
mSetQuat, mChangeObject, mSetupObject, mSolveObject, mScrambleObject, |
... | ... | |
74 | 71 |
private int mScrambleObjectNum; |
75 | 72 |
private int mAddRotationAxis, mAddRotationRowBitmap, mAddRotationAngle; |
76 | 73 |
private long mAddRotationDuration; |
77 |
private ActionFinishedListener mAddActionListener;
|
|
74 |
private MovesFinished mAddActionListener;
|
|
78 | 75 |
private long mAddRotationID, mRemoveRotationID; |
79 | 76 |
private int mCubit, mFace, mNewColor; |
80 | 77 |
private int mNearestAngle; |
... | ... | |
602 | 599 |
// PUBLIC API |
603 | 600 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
604 | 601 |
|
605 |
public void addRotation(ActionFinishedListener listener, int axis, int rowBitmap, int angle, long duration)
|
|
602 |
public void addRotation(MovesFinished listener, int axis, int rowBitmap, int angle, long duration)
|
|
606 | 603 |
{ |
607 | 604 |
mAddRotation = true; |
608 | 605 |
|
Also available in: Unified diff
Abstract the part that controls the 'Locked' and 'Back Moves' buttons from the two activities: the main one and the tutorial one.
This code had been duplicated there.