Project

General

Profile

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

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

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2021 Leszek Koltunski                                                               //
3
//                                                                                               //
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
import org.distorted.objectlib.helpers.ObjectLibInterface;
23
import org.distorted.objectlib.main.ObjectType;
24

    
25
import java.lang.ref.WeakReference;
26

    
27
///////////////////////////////////////////////////////////////////////////////////////////////////
28

    
29
public class TutorialObjectLibInterface implements ObjectLibInterface
30
{
31
   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
   public void onSolved() { }
44
   public int getCurrentColor() { return 0; }
45
   public int cubitIsLocked(ObjectType type, int cubit) { return 0; }
46

    
47
///////////////////////////////////////////////////////////////////////////////////////////////////
48

    
49
   public void onFinishRotation(int axis, int row, int angle)
50
     {
51
     TutorialActivity act = mAct.get();
52
     TutorialScreen state = act.getState();
53
     state.addMove(act, axis, row, angle);
54
     }
55

    
56
///////////////////////////////////////////////////////////////////////////////////////////////////
57

    
58
   public void failedToDrag()
59
     {
60
     TutorialActivity act = mAct.get();
61
     TutorialScreen state = act.getState();
62
     state.reddenLock(act);
63
     }
64
}
(3-3/7)