Project

General

Profile

« Previous | Next » 

Revision 032657c3

Added by Leszek Koltunski 23 days ago

improvements to the API

View differences:

src/main/java/org/distorted/config/ConfigObjectLibInterface.java
33 33

  
34 34
///////////////////////////////////////////////////////////////////////////////////////////////////
35 35

  
36
  public void onWinEffectFinished(long startTime, long endTime, String debug, int scrambleNum) { }
36
  public void onWinEffectFinished(long startTime, long endTime, int scrambleNum) { }
37 37
  public void onScrambleEffectFinished() { }
38 38
  public void onBeginRotation() { }
39 39
  public void onSolved() { }
src/main/java/org/distorted/helpers/MovesController.java
61 61
      if( numMoves>0 )
62 62
        {
63 63
        ObjectMove move = mMoves.remove(numMoves-1);
64
        int angle = move.getAngle();
65 64

  
66
        if( angle!=0 )
65
        if( move.isNonempty() )
67 66
          {
68 67
          mCanPrevMove = false;
69 68
          mControl = control;
src/main/java/org/distorted/info/InfoObjectLibInterface.java
20 20

  
21 21
public class InfoObjectLibInterface implements ObjectLibInterface
22 22
{
23
  public void onWinEffectFinished(long startTime, long endTime, String debug, int scrambleNum) { }
23
  public void onWinEffectFinished(long startTime, long endTime, int scrambleNum) { }
24 24
  public void onScrambleEffectFinished() { }
25 25
  public void onBeginRotation() { }
26 26
  public void onSolved() { }
src/main/java/org/distorted/patterns/PatternObjectLibInterface.java
29 29
  public void failedToDrag() { }
30 30
  public void onSolved() { }
31 31
  public void onObjectCreated(long time) { }
32
  public void onWinEffectFinished(long startTime, long endTime, String debug, int scrambleNum) { }
32
  public void onWinEffectFinished(long startTime, long endTime, int scrambleNum) { }
33 33
  public void onStickerTouched(int cubit, int face) { }
34 34
  public void onStickerUntouched() { }
35 35

  
src/main/java/org/distorted/play/PlayLibInterface.java
94 94

  
95 95
///////////////////////////////////////////////////////////////////////////////////////////////////
96 96

  
97
  private void reportRecord(PlayActivity act, long startTime, long endTime, String debug, int scrambleNum)
97
  private void reportRecord(PlayActivity act, long startTime, long endTime, int scrambleNum)
98 98
    {
99 99
    RubikScores scores  = RubikScores.getInstance();
100 100
    int objectOrdinal = act.getObjectOrdinal();
......
106 106

  
107 107
    if( BuildConfig.DEBUG )
108 108
      {
109
      android.util.Log.e("libInterface", debug);
110 109
      android.util.Log.e("libInterface", name);
111 110
      android.util.Log.e("libInterface", record);
112 111
      }
......
116 115
        {
117 116
        long timeNow = System.currentTimeMillis();
118 117
        long elapsed = timeNow - startTime;
119
        String suspicious ="start"+startTime+"end"+endTime+"elapsed"+elapsed+"obj"+objName+"record"+mNewRecord+"scrambles"+scrambleNum+debug;
118
        String suspicious ="start"+startTime+"end"+endTime+"elapsed"+elapsed+"obj"+objName+"record"+mNewRecord+"scrambles"+scrambleNum;
120 119
        RubikNetwork network = RubikNetwork.getInstance();
121 120
        network.suspicious(suspicious,act);
122 121
        }
......
126 125
      if( analytics!=null )
127 126
        {
128 127
        Bundle bundle = new Bundle();
129
        bundle.putString(FirebaseAnalytics.Param.CONTENT_TYPE, debug);
130 128
        bundle.putString(FirebaseAnalytics.Param.CHARACTER, name);
131 129
        bundle.putString(FirebaseAnalytics.Param.LEVEL, record);
132 130
        analytics.logEvent(FirebaseAnalytics.Event.LEVEL_UP, bundle);
......
288 286

  
289 287
///////////////////////////////////////////////////////////////////////////////////////////////////
290 288

  
291
  public void onWinEffectFinished(long startTime, long endTime, String debug, int scrambleNum)
289
  public void onWinEffectFinished(long startTime, long endTime, int scrambleNum)
292 290
    {
293 291
    if( ScreenList.getCurrentScreen()==ScreenList.SOLV )
294 292
      {
......
297 295
      TwistyObject obj = control.getObject();
298 296
      boolean submittable = obj.isSubmittable();
299 297

  
300
      if( submittable ) reportRecord(act,startTime,endTime,debug,scrambleNum);
298
      if( submittable ) reportRecord(act,startTime,endTime,scrambleNum);
301 299

  
302 300
      RubikScores scores = RubikScores.getInstance();
303 301
      int numWins = scores.incrementNumWins();
src/main/java/org/distorted/solvers/ScreenSolutionMultiphased.java
353 353
    for(int m=0; m<len; m++)
354 354
      {
355 355
      ObjectMove mv = moves[front ? start+m : end-1-m];
356
      ret[m] = new ObjectMove( mv.getAxis(), mv.getRowBitmap(), front ? mv.getAngle() : -mv.getAngle() );
356
      ret[m] = new ObjectMove(mv,front);
357 357
      }
358 358

  
359 359
    return ret;
......
378 378
      for(int p=0; p<l; p++)
379 379
        {
380 380
        ObjectMove mve = mv[front ? p : l-1-p];
381
        ret[index++] = new ObjectMove( mve.getAxis(), mve.getRowBitmap(), front ? mve.getAngle() : -mve.getAngle() );
381
        ret[index++] = new ObjectMove(mve,front);
382 382
        }
383 383
      }
384 384

  
src/main/java/org/distorted/solvers/ScreenSolutionSinglephased.java
191 191
        }
192 192
      else
193 193
        {
194
        int bareAngle = mMoves[mCurrMove-1].getAngle();
194
        ObjectMove move = mMoves[mCurrMove-1];
195 195

  
196
        if( bareAngle!=0 )
196
        if( move.isNonempty() )
197 197
          {
198 198
          mCanRotate = false;
199
          control.addForwardRotation(this, mMoves[mCurrMove-1], MILLIS_PER_DEGREE);
199
          control.addForwardRotation(this, move, MILLIS_PER_DEGREE);
200 200
          }
201 201
        else
202 202
          {
......
225 225
        }
226 226
      else
227 227
        {
228
        int bareAngle = mMoves[mCurrMove].getAngle();
228
        ObjectMove move = mMoves[mCurrMove];
229 229

  
230
        if( bareAngle!=0 )
230
        if( move.isNonempty() )
231 231
          {
232 232
          mCanRotate = false;
233
          control.addBackwardRotation(this, mMoves[mCurrMove], MILLIS_PER_DEGREE);
233
          control.addBackwardRotation(this, move, MILLIS_PER_DEGREE);
234 234
          }
235 235
        else
236 236
          {
src/main/java/org/distorted/solvers/SolverObjectLibInterface.java
45 45
  public void failedToDrag() { }
46 46
  public void onSolved() { }
47 47
  public void onObjectCreated(long time) { }
48
  public void onWinEffectFinished(long startTime, long endTime, String debug, int scrambleNum) { }
48
  public void onWinEffectFinished(long startTime, long endTime, int scrambleNum) { }
49 49

  
50 50
///////////////////////////////////////////////////////////////////////////////////////////////////
51 51

  
src/main/java/org/distorted/tutorials/TutorialObjectLibInterface.java
33 33

  
34 34
///////////////////////////////////////////////////////////////////////////////////////////////////
35 35

  
36
  public void onWinEffectFinished(long startTime, long endTime, String debug, int scrambleNum) { }
36
  public void onWinEffectFinished(long startTime, long endTime, int scrambleNum) { }
37 37
  public void onScrambleEffectFinished() { }
38 38
  public void onBeginRotation() { }
39 39
  public void onSolved() { }

Also available in: Unified diff