Project

General

Profile

« Previous | Next » 

Revision 1ba56d95

Added by Leszek Koltunski over 2 years ago

Simplification for the new way of storing records.

View differences:

src/main/java/org/distorted/external/RubikScores.java
19 19
import com.google.firebase.crashlytics.FirebaseCrashlytics;
20 20

  
21 21
import org.distorted.main.BuildConfig;
22
import org.distorted.objectlib.main.ObjectType;
23 22
import org.distorted.objects.RubikObject;
24 23
import org.distorted.objects.RubikObjectList;
25 24

  
......
401 400

  
402 401
            if( subm>=0 && subm<=1 )
403 402
              {
404
              int staticNumScrambles = ObjectType.getStaticNumScrambles(ordinal);
405

  
406
              if( level==MAX_RECORD )
407
                {
408
                android.util.Log.e("D", "object: "+nameStr+" level="+level+" RECORD DETECTED!");
409
                }
410

  
411
              if( level>=staticNumScrambles )
412
                {
413
                android.util.Log.e("D", "object: "+nameStr+" level="+level+" RECORD DETECTED!");
414
                level = MAX_RECORD;
415
                }
416

  
417 403
              MapValue value = new MapValue(time,subm);
418 404
              int key = mapKey(ordinal,level);
419 405
              mMap.put(key,value);
src/main/java/org/distorted/objects/RubikObject.java
35 35

  
36 36
public class RubikObject
37 37
{
38
  public static final int FAST_SCRAMBLES = 80;
39

  
38 40
  private final String mLowerName, mUpperName;
39 41
  private final int mIconID;
40 42
  private final String[][] mPatterns;
src/main/java/org/distorted/screens/RubikScreenPlay.java
354 354
      @Override
355 355
      public void onClick(View v)
356 356
        {
357
        int currObject = RubikObjectList.getCurrObject();
358
        RubikObject object = RubikObjectList.getObject(currObject);
359
        int numScrambles = object==null ? 0 : 2*object.getNumScramble();
360 357
        mShouldReactToEndOfScrambling = false;
361
        act.getControl().fastScrambleObject(numScrambles);
358
        act.getControl().fastScrambleObject(RubikObject.FAST_SCRAMBLES);
362 359
        }
363 360
      });
364 361
    }
src/main/java/org/distorted/tutorials/TutorialScreen.java
18 18
import org.distorted.main.R;
19 19
import org.distorted.main.RubikActivity;
20 20
import org.distorted.objects.RubikObject;
21
import org.distorted.objects.RubikObjectList;
22 21
import org.distorted.helpers.TransparentImageButton;
23 22

  
24 23
///////////////////////////////////////////////////////////////////////////////////////////////////
......
61 60
      @Override
62 61
      public void onClick(View v)
63 62
        {
64
        int object = RubikObjectList.getCurrObject();
65
        RubikObject obj = RubikObjectList.getObject(object);
66
        int numScrambles = obj==null ? 0 : 2*obj.getNumScramble();
67
        act.getControl().fastScrambleObject(numScrambles);
63
        act.getControl().fastScrambleObject(RubikObject.FAST_SCRAMBLES);
68 64
        }
69 65
      });
70 66
    }

Also available in: Unified diff