Project

General

Profile

« Previous | Next » 

Revision 714292f1

Added by Leszek Koltunski about 4 years ago

Minor.

View differences:

src/main/java/org/distorted/scores/RubikScores.java
32 32
public class RubikScores
33 33
  {
34 34
  private static final long NO_RECORD = Integer.MAX_VALUE;
35
  private static RubikScores mThis;
36

  
35 37
  private long[][][] mRecords;
36 38

  
37 39
///////////////////////////////////////////////////////////////////////////////////////////////////
38 40

  
39
  public RubikScores()
41
  private RubikScores()
40 42
    {
41 43
    mRecords = new long[NUM_OBJECTS][MAX_SIZE][MAX_SCRAMBLE];
42 44

  
......
48 50
          }
49 51
    }
50 52

  
53
///////////////////////////////////////////////////////////////////////////////////////////////////
54

  
55
  public static RubikScores getInstance()
56
    {
57
    if( mThis==null )
58
      {
59
      mThis = new RubikScores();
60
      }
61

  
62
    return mThis;
63
    }
64

  
51 65
///////////////////////////////////////////////////////////////////////////////////////////////////
52 66

  
53 67
  public void savePreferences(SharedPreferences.Editor editor)
......
148 162
      if( mRecords[object][size][scramble-1]> timeTaken )
149 163
        {
150 164
        mRecords[object][size][scramble-1] = timeTaken;
151
        android.util.Log.e("solv","new record!");
165
        android.util.Log.e("RubikScores","new record: ("+object+","+size+","+scramble+") ="+timeTaken);
152 166
        }
153 167
      }
154 168
    }
169

  
170
///////////////////////////////////////////////////////////////////////////////////////////////////
171

  
172
  public long getRecord(int object, int size, int scramble)
173
    {
174
    int maxsize = RubikObjectList.getObject(object).getSizes().length;
175

  
176
    if( object>=0 && object<NUM_OBJECTS && size>=0 && size<maxsize && scramble>=1 && scramble<=MAX_SCRAMBLE )
177
      {
178
      return mRecords[object][size][scramble];
179
      }
180

  
181
    return -1;
182
    }
155 183
  }

Also available in: Unified diff