Project

General

Profile

« Previous | Next » 

Revision 00fcfefa

Added by Leszek Koltunski over 1 year ago

All users who are upgrading from a version <1.11.4, where there was no concept of 'stars', get all their stars.

View differences:

src/main/java/org/distorted/external/RubikScores.java
24 24
import org.distorted.screens.RubikScreenPlay;
25 25

  
26 26
import static org.distorted.objectlib.main.ObjectType.MAX_SCRAMBLES;
27
import static org.distorted.screens.RubikScreenPlay.LEVELS_SHOWN;
27 28

  
28 29
///////////////////////////////////////////////////////////////////////////////////////////////////
29 30
// hold my own scores, and some other statistics.
......
249 250
    return mNumStars;
250 251
    }
251 252

  
253
///////////////////////////////////////////////////////////////////////////////////////////////////
254

  
255
  public void correctNumStars()
256
    {
257
    int numObjects = RubikObjectList.getNumObjects();
258

  
259
    for(int obj=0; obj<numObjects; obj++)
260
      {
261
      for(int level=0; level<=RubikScreenPlay.LEVELS_SHOWN; level++)
262
        {
263
        if( isSolved(obj,level) )
264
          {
265
          int numStars = computeNumStars(level+1);
266
          mNumStars += numStars;
267
          }
268
        }
269
      }
270
    }
271

  
272
///////////////////////////////////////////////////////////////////////////////////////////////////
273

  
274
  public int computeNumStars(int level)
275
    {
276
    return level>=LEVELS_SHOWN ? 50 : level;
277
    }
278

  
252 279
///////////////////////////////////////////////////////////////////////////////////////////////////
253 280

  
254 281
  public void setName(String newName)

Also available in: Unified diff