Project

General

Profile

Download (21.8 KB) Statistics
| Branch: | Tag: | Revision:

magiccube / src / main / java / org / distorted / screens / RubikScreenPlay.java @ 8ab435b9

1
///////////////////////////////////////////////////////////////////////////////////////////////////
2
// Copyright 2020 Leszek Koltunski                                                               //
3
//                                                                                               //
4
// This file is part of Magic Cube.                                                              //
5
//                                                                                               //
6
// Magic Cube is free software: you can redistribute it and/or modify                            //
7
// it under the terms of the GNU General Public License as published by                          //
8
// the Free Software Foundation, either version 2 of the License, or                             //
9
// (at your option) any later version.                                                           //
10
//                                                                                               //
11
// Magic Cube is distributed in the hope that it will be useful,                                 //
12
// but WITHOUT ANY WARRANTY; without even the implied warranty of                                //
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                 //
14
// GNU General Public License for more details.                                                  //
15
//                                                                                               //
16
// You should have received a copy of the GNU General Public License                             //
17
// along with Magic Cube.  If not, see <http://www.gnu.org/licenses/>.                           //
18
///////////////////////////////////////////////////////////////////////////////////////////////////
19

    
20
package org.distorted.screens;
21

    
22
import android.content.Context;
23
import android.content.SharedPreferences;
24
import android.graphics.drawable.BitmapDrawable;
25
import android.os.Build;
26
import android.os.Bundle;
27
import android.util.TypedValue;
28
import android.view.Gravity;
29
import android.view.LayoutInflater;
30
import android.view.View;
31
import android.widget.Button;
32
import android.widget.GridLayout;
33
import android.widget.ImageButton;
34
import android.widget.LinearLayout;
35
import android.widget.PopupWindow;
36
import android.widget.ScrollView;
37

    
38
import org.distorted.objectlib.main.ObjectType;
39

    
40
import org.distorted.main.R;
41
import org.distorted.main.RubikActivity;
42
import org.distorted.objectlib.main.ObjectPreRender;
43
import org.distorted.dialogs.RubikDialogAbout;
44
import org.distorted.dialogs.RubikDialogPattern;
45
import org.distorted.dialogs.RubikDialogScores;
46
import org.distorted.dialogs.RubikDialogTutorial;
47
import org.distorted.helpers.TransparentButton;
48
import org.distorted.helpers.TransparentImageButton;
49
import org.distorted.network.RubikScores;
50

    
51
///////////////////////////////////////////////////////////////////////////////////////////////////
52

    
53
public class RubikScreenPlay extends RubikScreenBase
54
  {
55
  public static final int NUM_COLUMNS  = 4;
56
  public static final int LEVELS_SHOWN = 10;
57
  public static int MAX_LEVEL;
58
  public static final ObjectType DEF_OBJECT= ObjectType.CUBE_3;
59

    
60
  private static final int[] BUTTON_LABELS = { R.string.scores,
61
                                               R.string.patterns,
62
                                            //   R.string.control,
63
                                               R.string.solver,
64
                                               R.string.tutorials,
65
                                               R.string.about };
66

    
67
  private static final int NUM_BUTTONS = BUTTON_LABELS.length;
68
  private static final float LAST_BUTTON = 1.5f;
69
  private static final int[] mLocation = new int[2];
70

    
71
  private ImageButton mObjButton, mMenuButton, mSolveButton;
72
  private Button mPlayButton;
73
  private PopupWindow mObjectPopup, mMenuPopup, mPlayPopup;
74
  private ObjectType mObject = DEF_OBJECT;
75
  private int mObjectSize, mMenuLayoutWidth, mMenuLayoutHeight, mPlayLayoutWidth;
76
  private int mLevelValue;
77
  private float mButtonSize, mMenuItemSize, mMenuTextSize;
78
  private int mColCount, mRowCount, mMaxRowCount;
79
  private LinearLayout mPlayLayout;
80
  private int mUpperBarHeight;
81

    
82
  static
83
    {
84
    ObjectType[] types = ObjectType.values();
85
    int max = Integer.MIN_VALUE;
86

    
87
    for (ObjectType type : types)
88
      {
89
      int cur = getDBLevel(type);
90
      if( cur>max ) max = cur;
91
      }
92

    
93
    MAX_LEVEL = max;
94
    }
95

    
96
///////////////////////////////////////////////////////////////////////////////////////////////////
97

    
98
  void leaveScreen(RubikActivity act)
99
    {
100

    
101
    }
102

    
103
///////////////////////////////////////////////////////////////////////////////////////////////////
104

    
105
  void enterScreen(final RubikActivity act)
106
    {
107
    float width = act.getScreenWidthInPixels();
108
    float height= act.getScreenHeightInPixels();
109
    mUpperBarHeight = act.getHeightUpperBar();
110

    
111
    mMenuTextSize = width*RubikActivity.MENU_MED_TEXT_SIZE;
112
    mButtonSize   = width*RubikActivity.BUTTON_TEXT_SIZE;
113
    mMenuItemSize = width*RubikActivity.MENU_ITEM_SIZE;
114

    
115
    mRowCount = (ObjectType.NUM_OBJECTS + NUM_COLUMNS-1) / NUM_COLUMNS;
116
    mColCount = NUM_COLUMNS;
117

    
118
    // TOP ////////////////////////////
119
    LinearLayout layoutTop = act.findViewById(R.id.upperBar);
120
    layoutTop.removeAllViews();
121

    
122
    setupObjectWindow(act,width,height);
123
    setupObjectButton(act,width);
124
    layoutTop.addView(mObjButton);
125

    
126
    setupMenuWindow(act,width);
127
    setupMenuButton(act,width);
128
    layoutTop.addView(mMenuButton);
129

    
130
    setupPlayWindow(act,width);
131
    setupPlayButton(act,width,height);
132
    layoutTop.addView(mPlayButton);
133

    
134
    setupSolveButton(act,width);
135
    createBottomPane(act,width,mSolveButton);
136
    }
137

    
138
//////////////////////////////////////////////////////////////////////////////////////////////////
139

    
140
  private void setupObjectButton(final RubikActivity act, final float width)
141
    {
142
    final int margin  = (int)(width*RubikActivity.MARGIN);
143
    final int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_menu,R.drawable.ui_medium_cube_menu, R.drawable.ui_big_cube_menu, R.drawable.ui_huge_cube_menu);
144

    
145
    mObjButton = new TransparentImageButton(act, icon, width,LinearLayout.LayoutParams.MATCH_PARENT);
146

    
147
    mObjButton.setOnClickListener( new View.OnClickListener()
148
      {
149
      @Override
150
      public void onClick(View view)
151
        {
152
        if( mObjectPopup!=null && act.getPreRender().isUINotBlocked())
153
          {
154
          int rowCount = Math.min(mMaxRowCount,mRowCount);
155
          View popupView = mObjectPopup.getContentView();
156
          popupView.setSystemUiVisibility(RubikActivity.FLAGS);
157
          displayPopup(act,view,mObjectPopup,mObjectSize*mColCount,mObjectSize*rowCount,margin,margin);
158
          }
159
        }
160
      });
161
    }
162

    
163
///////////////////////////////////////////////////////////////////////////////////////////////////
164

    
165
  private void setupPlayButton(final RubikActivity act, final float width, final float height)
166
    {
167
    final int margin   = (int)(width*RubikActivity.MARGIN);
168
    final int maxHeight= (int)(0.9f*(height-mUpperBarHeight) );
169

    
170
    mPlayButton = new TransparentButton(act, R.string.play, mButtonSize, width);
171

    
172
    mPlayButton.setOnClickListener( new View.OnClickListener()
173
      {
174
      @Override
175
      public void onClick(View view)
176
        {
177
        if( mPlayPopup!=null && act.getPreRender().isUINotBlocked())
178
          {
179
          View popupView = mPlayPopup.getContentView();
180
          popupView.setSystemUiVisibility(RubikActivity.FLAGS);
181
          final int dbLevel = getDBLevel(mObject);
182
          final int levelsShown = Math.min(dbLevel,LEVELS_SHOWN);
183
          final int popupHeight = (int)(levelsShown*(mMenuItemSize+margin)+3*margin+mMenuItemSize*(LAST_BUTTON-1.0f));
184
          final int realHeight = Math.min(popupHeight,maxHeight);
185
          displayPopup(act,view,mPlayPopup,mPlayLayoutWidth,realHeight,margin,margin);
186
          }
187
        }
188
      });
189
    }
190

    
191
///////////////////////////////////////////////////////////////////////////////////////////////////
192

    
193
  private void setupMenuButton(final RubikActivity act, final float width)
194
    {
195
    final int margin  = (int)(width*RubikActivity.MARGIN);
196
    final int icon = RubikActivity.getDrawable(R.drawable.ui_small_menu,R.drawable.ui_medium_menu, R.drawable.ui_big_menu, R.drawable.ui_huge_menu);
197

    
198
    mMenuButton = new TransparentImageButton(act, icon, width,LinearLayout.LayoutParams.MATCH_PARENT);
199

    
200
    mMenuButton.setOnClickListener( new View.OnClickListener()
201
      {
202
      @Override
203
      public void onClick(View view)
204
        {
205
        if( mMenuPopup!=null && act.getPreRender().isUINotBlocked())
206
          {
207
          View popupView = mMenuPopup.getContentView();
208
          popupView.setSystemUiVisibility(RubikActivity.FLAGS);
209
          displayPopup(act,view,mMenuPopup,mMenuLayoutWidth,mMenuLayoutHeight,(int)(-width/12),margin);
210
          }
211
        }
212
      });
213
    }
214

    
215
///////////////////////////////////////////////////////////////////////////////////////////////////
216

    
217
  private void setupObjectWindow(final RubikActivity act, final float width, final float height)
218
    {
219
    int icon = RubikActivity.getDrawable(R.drawable.small_cube2,R.drawable.medium_cube2, R.drawable.big_cube2, R.drawable.huge_cube2);
220

    
221
    BitmapDrawable bd = (BitmapDrawable) act.getResources().getDrawable(icon);
222
    int cubeWidth = bd.getIntrinsicWidth();
223
    int margin = (int)(width*RubikActivity.LARGE_MARGIN);
224
    mObjectSize = (int)(cubeWidth + 2*margin + 0.5f);
225
    mMaxRowCount = (int)(0.9f*(height-mUpperBarHeight)/mObjectSize);
226
    GridLayout objectGrid = new GridLayout(act);
227
    mObjectPopup = new PopupWindow(act);
228
    mObjectPopup.setFocusable(true);
229

    
230
    if( mMaxRowCount<mRowCount )
231
      {
232
      ScrollView scrollView = new ScrollView(act);
233
      scrollView.addView(objectGrid);
234
      mObjectPopup.setContentView(scrollView);
235
      }
236
    else
237
      {
238
      mObjectPopup.setContentView(objectGrid);
239
      }
240

    
241
    GridLayout.Spec[] rowSpecs = new GridLayout.Spec[mRowCount];
242
    GridLayout.Spec[] colSpecs = new GridLayout.Spec[mColCount];
243

    
244
    objectGrid.setColumnCount(mColCount);
245
    objectGrid.setRowCount(mRowCount);
246

    
247
    int[] nextInRow = new int[mRowCount];
248

    
249
    for(int row=0; row<mRowCount; row++)
250
      {
251
      rowSpecs[row] = GridLayout.spec(row);
252
      nextInRow[row]= 0;
253
      }
254
    for(int col=0; col<mColCount; col++)
255
      {
256
      colSpecs[col] = GridLayout.spec(col);
257
      }
258

    
259
    for(int object = 0; object< ObjectType.NUM_OBJECTS; object++)
260
      {
261
      final ObjectType list = ObjectType.getObject(object);
262
      int iconSize = RubikActivity.getDrawableSize();
263
      int icons = list.getIconID(iconSize);
264
      final int obj = object;
265
      int row = object/NUM_COLUMNS;
266

    
267
      ImageButton button = new ImageButton(act);
268
      button.setBackgroundResource(icons);
269
      button.setOnClickListener( new View.OnClickListener()
270
        {
271
        @Override
272
        public void onClick(View v)
273
          {
274
          if( act.getPreRender().isUINotBlocked() && ScreenList.getCurrentScreen()== ScreenList.PLAY )
275
            {
276
            mObject = ObjectType.getObject(obj);
277
            act.changeObject(list, true);
278
            adjustLevels(act);
279
            mMovesController.clearMoves(act);
280
            }
281

    
282
          mObjectPopup.dismiss();
283
          }
284
        });
285

    
286
      GridLayout.LayoutParams params = new GridLayout.LayoutParams(rowSpecs[row],colSpecs[nextInRow[row]]);
287
      params.bottomMargin = margin;
288
      params.topMargin    = margin;
289
      params.leftMargin   = margin;
290
      params.rightMargin  = margin;
291

    
292
      nextInRow[row]++;
293

    
294
      objectGrid.addView(button, params);
295
      }
296
    }
297

    
298
///////////////////////////////////////////////////////////////////////////////////////////////////
299

    
300
  private void setupMenuWindow(final RubikActivity act, final float width)
301
    {
302
    LayoutInflater layoutInflater = (LayoutInflater)act.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
303
    final View layout = layoutInflater.inflate(R.layout.popup_menu, null);
304
    LinearLayout menuLayout = layout.findViewById(R.id.menuGrid);
305

    
306
    mMenuPopup = new PopupWindow(act);
307
    mMenuPopup.setContentView(layout);
308
    mMenuPopup.setFocusable(true);
309
    int margin  = (int)(width*RubikActivity.MARGIN);
310
    int padding = (int)(width*RubikActivity.PADDING);
311

    
312
    mMenuLayoutWidth = (int)(width/2);
313
    mMenuLayoutHeight= (int)(2*margin + NUM_BUTTONS*(mMenuItemSize+margin));
314

    
315
    LinearLayout.LayoutParams p = new LinearLayout.LayoutParams( mMenuLayoutWidth - 2*padding, (int)mMenuItemSize);
316

    
317
    for(int i=0; i<NUM_BUTTONS; i++)
318
      {
319
      final int but = i;
320
      Button button = new Button(act);
321
      button.setLayoutParams(p);
322
      button.setText(BUTTON_LABELS[i]);
323
      button.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
324

    
325
      button.setOnClickListener( new View.OnClickListener()
326
        {
327
        @Override
328
        public void onClick(View v)
329
          {
330
          mMenuPopup.dismiss();
331
          MenuAction(act,but);
332
          }
333
        });
334

    
335
      menuLayout.addView(button);
336
      }
337
    }
338

    
339
///////////////////////////////////////////////////////////////////////////////////////////////////
340

    
341
  private void setupPlayWindow(final RubikActivity act, final float width)
342
    {
343
    LayoutInflater layoutInflater = (LayoutInflater)act.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
344
    final View layout = layoutInflater.inflate(R.layout.popup_play, null);
345
    mPlayLayout = layout.findViewById(R.id.playGrid);
346

    
347
    mPlayLayoutWidth = (int)(width*0.4f);
348

    
349
    mPlayPopup = new PopupWindow(act);
350
    mPlayPopup.setContentView(layout);
351
    mPlayPopup.setFocusable(true);
352

    
353
    adjustLevels(act);
354
    }
355

    
356
///////////////////////////////////////////////////////////////////////////////////////////////////
357

    
358
  private void MenuAction(RubikActivity act, int button)
359
    {
360
    switch(button)
361
      {
362
      case 0: Bundle sBundle = new Bundle();
363
              sBundle.putInt("tab", mObject.ordinal() );
364
              sBundle.putBoolean("submitting", false);
365
              RubikDialogScores scores = new RubikDialogScores();
366
              scores.setArguments(sBundle);
367
              scores.show(act.getSupportFragmentManager(), null);
368
              break;
369
      case 1: RubikDialogPattern pDiag = new RubikDialogPattern();
370
              Bundle pBundle = new Bundle();
371
              int pOrd = getPatternOrdinal();
372
              pBundle.putInt("tab", pOrd );
373
              pDiag.setArguments(pBundle);
374
              pDiag.show( act.getSupportFragmentManager(), RubikDialogPattern.getDialogTag() );
375
              break;
376
/*
377
      case 2: RubikControl control = RubikControl.getInstance();
378
              //control.animateAll(act);
379
              control.animateRotate(act);
380
              break;
381
 */
382
      case 2: ScreenList.switchScreen(act, ScreenList.SVER);
383
              break;
384
      case 3: RubikDialogTutorial tDiag = new RubikDialogTutorial();
385
              Bundle tBundle = new Bundle();
386
              int tOrd = getTutorialOrdinal();
387
              tBundle.putInt("tab", tOrd );
388
              tDiag.setArguments(tBundle);
389
              tDiag.show( act.getSupportFragmentManager(), RubikDialogTutorial.getDialogTag() );
390
              break;
391
      case 4: RubikDialogAbout aDiag = new RubikDialogAbout();
392
              aDiag.show(act.getSupportFragmentManager(), null);
393
              break;
394
      }
395
    }
396

    
397
///////////////////////////////////////////////////////////////////////////////////////////////////
398

    
399
  void setupSolveButton(final RubikActivity act, final float width)
400
    {
401
    int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube_solve,R.drawable.ui_medium_cube_solve, R.drawable.ui_big_cube_solve, R.drawable.ui_huge_cube_solve);
402
    mSolveButton = new TransparentImageButton(act, icon, width,LinearLayout.LayoutParams.MATCH_PARENT);
403

    
404
    mSolveButton.setOnClickListener( new View.OnClickListener()
405
      {
406
      @Override
407
      public void onClick(View v)
408
        {
409
        act.getPreRender().solveObject();
410
        mMovesController.clearMoves(act);
411
        }
412
      });
413
    }
414

    
415
///////////////////////////////////////////////////////////////////////////////////////////////////
416

    
417
  public void savePreferences(SharedPreferences.Editor editor)
418
    {
419
    editor.putString("statePlay_objName", mObject.name() );
420

    
421
    if( mObjectPopup!=null )
422
      {
423
      mObjectPopup.dismiss();
424
      mObjectPopup = null;
425
      }
426

    
427
    if( mMenuPopup!=null )
428
      {
429
      mMenuPopup.dismiss();
430
      mMenuPopup = null;
431
      }
432

    
433
    if( mPlayPopup!=null )
434
      {
435
      mPlayPopup.dismiss();
436
      mPlayPopup = null;
437
      }
438
    }
439

    
440
///////////////////////////////////////////////////////////////////////////////////////////////////
441

    
442
  public void restorePreferences(SharedPreferences preferences)
443
    {
444
    String objName= preferences.getString("statePlay_objName", DEF_OBJECT.name() );
445
    int ordinal = ObjectType.getOrdinal(objName);
446
    mObject = ordinal>=0 ? ObjectType.values()[ordinal] : DEF_OBJECT;
447
    }
448

    
449
///////////////////////////////////////////////////////////////////////////////////////////////////
450

    
451
  public boolean setObject(RubikActivity act, ObjectType obj)
452
    {
453
    if( mObject!=obj )
454
      {
455
      mObject = obj;
456
      if( mPlayLayout!=null ) adjustLevels(act);
457
      return true;
458
      }
459

    
460
    return false;
461
    }
462

    
463
///////////////////////////////////////////////////////////////////////////////////////////////////
464
// work around lame bugs in Android's version <= 10 pop-up and split-screen modes
465

    
466
  private void displayPopup(RubikActivity act, View view, PopupWindow window, int w, int h, int xoff, int yoff)
467
    {
468
    View topLayout = act.findViewById(R.id.relativeLayout);
469
    boolean isFullScreen;
470

    
471
    if( topLayout!=null )
472
      {
473
      topLayout.getLocationOnScreen(mLocation);
474
      isFullScreen = (mLocation[1]==0);
475
      }
476
    else
477
      {
478
      isFullScreen = true;
479
      }
480

    
481
    // if on Android 11 or we are fullscreen
482
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R || isFullScreen )
483
      {
484
      window.showAsDropDown(view, xoff, yoff, Gravity.CENTER);
485
      window.update(view, w, h);
486
      }
487
    else  // Android 10 or below in pop-up mode or split-screen mode
488
      {
489
      view.getLocationOnScreen(mLocation);
490
      int width  = view.getWidth();
491
      int height = view.getHeight();
492
      int x = mLocation[0]+(width-w)/2;
493
      int y = mLocation[1]+height+yoff;
494

    
495
      window.showAsDropDown(view);
496
      window.update(x,y,w,h);
497
      }
498
    }
499

    
500
///////////////////////////////////////////////////////////////////////////////////////////////////
501

    
502
  private void adjustLevels(final RubikActivity act)
503
    {
504
    int dbLevel = getDBLevel(mObject);
505
    int numScrambles = ObjectType.getNumScramble(mObject.ordinal());
506
    int numLevel = Math.min(dbLevel, LEVELS_SHOWN);
507
    String[] levels = new String[numLevel];
508

    
509
    for(int i=0; i<numLevel-1; i++)
510
      {
511
      levels[i] = act.getString(R.string.lv_placeholder,i+1);
512
      }
513

    
514
    if( numLevel>0 )
515
      {
516
      levels[numLevel-1] = act.getString(R.string.level_full);
517
      }
518

    
519
    if( mLevelValue>dbLevel || mLevelValue<1 ||
520
       (mLevelValue<dbLevel || mLevelValue>LEVELS_SHOWN ) )
521
      {
522
      mLevelValue=1;
523
      }
524

    
525
    float width  = act.getScreenWidthInPixels();
526
    int margin   = (int)(width*RubikActivity.MARGIN);
527
    int padding  = (int)(width*RubikActivity.PADDING);
528
    int butWidth = mPlayLayoutWidth - 2*padding;
529
    int butHeight= (int)mMenuItemSize;
530
    int lastButH = (int)(mMenuItemSize*LAST_BUTTON) ;
531

    
532
    LinearLayout.LayoutParams pM = new LinearLayout.LayoutParams( butWidth, butHeight );
533
    pM.setMargins(margin, 0, margin, margin);
534
    LinearLayout.LayoutParams pT = new LinearLayout.LayoutParams( butWidth, butHeight );
535
    pT.setMargins(margin, margin, margin, margin);
536
    LinearLayout.LayoutParams pB = new LinearLayout.LayoutParams( butWidth, lastButH  );
537
    pB.setMargins(margin, margin, margin, 2*margin);
538

    
539
    mPlayLayout.removeAllViews();
540

    
541
    RubikScores scores = RubikScores.getInstance();
542

    
543
    for(int i=0; i<numLevel; i++)
544
      {
545
      final int level     = i<numLevel-1 ? i+1 : dbLevel;
546
      final int scrambles = i<numLevel-1 ? i+1 : numScrambles;
547
      Button button = new Button(act);
548
      button.setLayoutParams(i==0 ? pT : (i==numLevel-1 ? pB : pM));
549
      button.setText(levels[i]);
550
      button.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
551

    
552
      int icon = scores.isSolved(mObject.ordinal(), level-1) ? R.drawable.ui_solved : R.drawable.ui_notsolved;
553
      button.setCompoundDrawablesWithIntrinsicBounds(icon,0,0,0);
554

    
555
      button.setOnClickListener( new View.OnClickListener()
556
        {
557
        @Override
558
        public void onClick(View v)
559
          {
560
          ObjectPreRender pre = act.getPreRender();
561

    
562
          if(pre.isUINotBlocked())
563
            {
564
            if( mPlayPopup!=null ) mPlayPopup.dismiss();
565
            mLevelValue = level;
566
            pre.scrambleObject(scrambles);
567
            }
568
          }
569
        });
570

    
571
      mPlayLayout.addView(button);
572
      }
573
    }
574

    
575
///////////////////////////////////////////////////////////////////////////////////////////////////
576
// historically older versions of the app had lower 'maxScrambles' in case of several objects and
577
// those got remembered in the server-side DB already, so we need to keep using them. This function
578
// provides a map between 'maxScramble' of an object and its 'dbLevel'. All new objects will have
579
// those two values the same.
580

    
581
  public static int getDBLevel(ObjectType object)
582
    {
583
    switch(object)
584
      {
585
      case CUBE_3: return 16;
586
      case CUBE_4: return 20;
587
      case CUBE_5: return 24;
588
      case PYRA_4: return 14;
589
      case PYRA_5: return 20;
590
      case MEGA_5: return 35;
591
      case DIAM_2: return 10;
592
      case DIAM_3: return 18;
593
      case REDI_3: return 14;
594
      case HELI_3: return 18;
595
      case SKEW_3: return 17;
596
      case REX_3 : return 16;
597
      case MIRR_3: return 16;
598
      default    : return ObjectType.getNumScramble(object.ordinal());
599
      }
600
    }
601

    
602
///////////////////////////////////////////////////////////////////////////////////////////////////
603

    
604
  public int getLevel()
605
    {
606
    return mLevelValue;
607
    }
608

    
609
///////////////////////////////////////////////////////////////////////////////////////////////////
610

    
611
  public ObjectType getObject()
612
    {
613
    return mObject;
614
    }
615
  }
(5-5/10)