Project

General

Profile

« Previous | Next » 

Revision 52547ba7

Added by Leszek Koltunski over 2 years ago

Simplification

View differences:

src/main/java/org/distorted/screens/RubikScreenAbstract.java
1 1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2020 Leszek Koltunski                                                               //
2
// Copyright 2021 Leszek Koltunski                                                               //
3 3
//                                                                                               //
4 4
// This file is part of Magic Cube.                                                              //
5 5
//                                                                                               //
......
22 22
import android.content.SharedPreferences;
23 23

  
24 24
import org.distorted.main.RubikActivity;
25
import org.distorted.objectlib.main.ObjectType;
26
import org.distorted.patterns.RubikPatternList;
27
import org.distorted.tutorials.TutorialList;
28 25

  
29 26
///////////////////////////////////////////////////////////////////////////////////////////////////
30 27

  
31 28
public abstract class RubikScreenAbstract
32 29
  {
33
  int getPatternOrdinal()
34
    {
35
    RubikScreenPlay play = (RubikScreenPlay) ScreenList.PLAY.getScreenClass();
36
    ObjectType obj  = play.getObject();
37
    int ret = RubikPatternList.getOrdinal(obj);
38

  
39
    if( ret<0 )
40
      {
41
      ret = RubikPatternList.getOrdinal(RubikScreenPlay.DEF_OBJECT);
42
      }
43

  
44
    return ret;
45
    }
46

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

  
49
  int getTutorialOrdinal()
50
    {
51
    RubikScreenPlay play = (RubikScreenPlay) ScreenList.PLAY.getScreenClass();
52
    ObjectType obj  = play.getObject();
53

  
54
    int ret = TutorialList.getOrdinal(obj);
55

  
56
    if( ret<0 )
57
      {
58
      ret = TutorialList.getOrdinal(RubikScreenPlay.DEF_OBJECT);
59
      }
60

  
61
    return ret;
62
    }
63

  
64
///////////////////////////////////////////////////////////////////////////////////////////////////
65

  
66 30
  abstract void enterScreen(RubikActivity act);
67 31
  abstract void leaveScreen(RubikActivity act);
68 32
  public abstract void savePreferences(SharedPreferences.Editor editor);

Also available in: Unified diff