1 |
1cd323dd
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
2 |
05c20dad
|
Leszek Koltunski
|
// Copyright 2021 Leszek Koltunski //
|
3 |
1cd323dd
|
Leszek Koltunski
|
// //
|
4 |
|
|
// This file is part of Magic Cube. //
|
5 |
|
|
// //
|
6 |
|
|
// Magic Cube is free software: you can redistribute it and/or modify //
|
7 |
|
|
// it under the terms of the GNU General Public License as published by //
|
8 |
|
|
// the Free Software Foundation, either version 2 of the License, or //
|
9 |
|
|
// (at your option) any later version. //
|
10 |
|
|
// //
|
11 |
|
|
// Magic Cube is distributed in the hope that it will be useful, //
|
12 |
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
|
13 |
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
|
14 |
|
|
// GNU General Public License for more details. //
|
15 |
|
|
// //
|
16 |
|
|
// You should have received a copy of the GNU General Public License //
|
17 |
|
|
// along with Magic Cube. If not, see <http://www.gnu.org/licenses/>. //
|
18 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
19 |
|
|
|
20 |
|
|
package org.distorted.tutorials;
|
21 |
|
|
|
22 |
0c52f5da
|
Leszek Koltunski
|
import org.distorted.library.main.DistortedFramebuffer;
|
23 |
|
|
|
24 |
e019c70b
|
Leszek Koltunski
|
import org.distorted.objectlib.helpers.ObjectLibInterface;
|
25 |
dd1a65c1
|
Leszek Koltunski
|
import org.distorted.objectlib.main.ObjectType;
|
26 |
1cd323dd
|
Leszek Koltunski
|
|
27 |
e019c70b
|
Leszek Koltunski
|
import java.lang.ref.WeakReference;
|
28 |
|
|
|
29 |
1cd323dd
|
Leszek Koltunski
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
30 |
|
|
|
31 |
e019c70b
|
Leszek Koltunski
|
public class TutorialObjectLibInterface implements ObjectLibInterface
|
32 |
1cd323dd
|
Leszek Koltunski
|
{
|
33 |
e019c70b
|
Leszek Koltunski
|
WeakReference<TutorialActivity> mAct;
|
34 |
|
|
|
35 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
36 |
|
|
|
37 |
|
|
TutorialObjectLibInterface(TutorialActivity act)
|
38 |
|
|
{
|
39 |
|
|
mAct = new WeakReference<>(act);
|
40 |
|
|
}
|
41 |
|
|
|
42 |
|
|
public void onWinEffectFinished(String debug, int scrambleNum) { }
|
43 |
|
|
public void onScrambleEffectFinished() { }
|
44 |
|
|
public void onBeginRotation() { }
|
45 |
1cd323dd
|
Leszek Koltunski
|
public void onSolved() { }
|
46 |
dd1a65c1
|
Leszek Koltunski
|
public int getCurrentColor() { return 0; }
|
47 |
|
|
public int cubitIsLocked(ObjectType type, int cubit) { return 0; }
|
48 |
|
|
|
49 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
50 |
|
|
|
51 |
e019c70b
|
Leszek Koltunski
|
public void onFinishRotation(int axis, int row, int angle)
|
52 |
dd1a65c1
|
Leszek Koltunski
|
{
|
53 |
e019c70b
|
Leszek Koltunski
|
TutorialActivity act = mAct.get();
|
54 |
|
|
TutorialScreen state = act.getState();
|
55 |
|
|
state.addMove(act, axis, row, angle);
|
56 |
dd1a65c1
|
Leszek Koltunski
|
}
|
57 |
|
|
|
58 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
59 |
|
|
|
60 |
e019c70b
|
Leszek Koltunski
|
public void failedToDrag()
|
61 |
dd1a65c1
|
Leszek Koltunski
|
{
|
62 |
e019c70b
|
Leszek Koltunski
|
TutorialActivity act = mAct.get();
|
63 |
|
|
TutorialScreen state = act.getState();
|
64 |
dd1a65c1
|
Leszek Koltunski
|
state.reddenLock(act);
|
65 |
|
|
}
|
66 |
e019c70b
|
Leszek Koltunski
|
|
67 |
|
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
68 |
|
|
|
69 |
0c52f5da
|
Leszek Koltunski
|
public DistortedFramebuffer getFramebuffer()
|
70 |
e019c70b
|
Leszek Koltunski
|
{
|
71 |
|
|
TutorialActivity act = mAct.get();
|
72 |
|
|
return act.getScreen();
|
73 |
|
|
}
|
74 |
1cd323dd
|
Leszek Koltunski
|
}
|