Revision 24679c47
Added by Leszek Koltunski over 1 year ago
src/main/java/org/distorted/external/RubikScores.java | ||
---|---|---|
30 | 30 |
|
31 | 31 |
public class RubikScores |
32 | 32 |
{ |
33 |
public static final int RECORD_FIRST = 0; |
|
34 |
public static final int RECORD_NEW = 1; |
|
35 |
public static final int RECORD_NOT_NEW = 2; |
|
36 |
|
|
33 | 37 |
public static final int MAX_RECORD = 10; |
34 | 38 |
public static final int MULT = 1000000; |
35 | 39 |
public static final long NO_RECORD = Long.MAX_VALUE; |
... | ... | |
238 | 242 |
|
239 | 243 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
240 | 244 |
|
241 |
public synchronized boolean setRecord(int object, int level, long record)
|
|
245 |
public synchronized int setRecord(int object, int level, long record)
|
|
242 | 246 |
{ |
243 | 247 |
int key = mapKey(object,level); |
244 | 248 |
MapValue oldValue = mMap.get(key); |
... | ... | |
247 | 251 |
{ |
248 | 252 |
MapValue value = new MapValue(record,0); |
249 | 253 |
mMap.put(key,value); |
250 |
return true;
|
|
254 |
return RECORD_FIRST;
|
|
251 | 255 |
} |
252 | 256 |
|
253 | 257 |
long oldRecord = oldValue.record; |
... | ... | |
256 | 260 |
{ |
257 | 261 |
MapValue value = new MapValue(record,0); |
258 | 262 |
mMap.put(key,value); |
259 |
return true;
|
|
263 |
return RECORD_NEW;
|
|
260 | 264 |
} |
261 | 265 |
|
262 |
return false;
|
|
266 |
return RECORD_NOT_NEW;
|
|
263 | 267 |
} |
268 |
|
|
264 | 269 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
265 | 270 |
|
266 | 271 |
public synchronized long getRecord(int object, int level) |
Also available in: Unified diff
Progress with marking objects as free.