Project

General

Profile

Download (3.18 KB) Statistics
| Branch: | Tag: | Revision:

magiccube / src / main / java / org / distorted / tutorials / TutorialObjectLibInterface.java @ 338babe8

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 e019c70b Leszek Koltunski
import org.distorted.objectlib.helpers.ObjectLibInterface;
23 dd1a65c1 Leszek Koltunski
import org.distorted.objectlib.main.ObjectType;
24 1cd323dd Leszek Koltunski
25 e019c70b Leszek Koltunski
import java.lang.ref.WeakReference;
26
27 1cd323dd Leszek Koltunski
///////////////////////////////////////////////////////////////////////////////////////////////////
28
29 e019c70b Leszek Koltunski
public class TutorialObjectLibInterface implements ObjectLibInterface
30 1cd323dd Leszek Koltunski
{
31 e019c70b Leszek Koltunski
   WeakReference<TutorialActivity> mAct;
32
33
///////////////////////////////////////////////////////////////////////////////////////////////////
34
35
  TutorialObjectLibInterface(TutorialActivity act)
36
    {
37
    mAct = new WeakReference<>(act);
38
    }
39
40
   public void onWinEffectFinished(String debug, int scrambleNum) { }
41
   public void onScrambleEffectFinished() { }
42
   public void onBeginRotation() { }
43 1cd323dd Leszek Koltunski
   public void onSolved() { }
44 dd1a65c1 Leszek Koltunski
   public int getCurrentColor() { return 0; }
45
   public int cubitIsLocked(ObjectType type, int cubit) { return 0; }
46
47
///////////////////////////////////////////////////////////////////////////////////////////////////
48
49 e019c70b Leszek Koltunski
   public void onFinishRotation(int axis, int row, int angle)
50 dd1a65c1 Leszek Koltunski
     {
51 e019c70b Leszek Koltunski
     TutorialActivity act = mAct.get();
52
     TutorialScreen state = act.getState();
53
     state.addMove(act, axis, row, angle);
54 dd1a65c1 Leszek Koltunski
     }
55
56
///////////////////////////////////////////////////////////////////////////////////////////////////
57
58 e019c70b Leszek Koltunski
   public void failedToDrag()
59 dd1a65c1 Leszek Koltunski
     {
60 e019c70b Leszek Koltunski
     TutorialActivity act = mAct.get();
61
     TutorialScreen state = act.getState();
62 dd1a65c1 Leszek Koltunski
     state.reddenLock(act);
63
     }
64 1cd323dd Leszek Koltunski
}