Project

General

Profile

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

magiccube / src / main / java / org / distorted / screens / RubikScreenPlay.java @ 2afc6754

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.ObjectControl;
39
import org.distorted.objectlib.main.ObjectType;
40

    
41
import org.distorted.main.R;
42
import org.distorted.main.RubikActivity;
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.solver,
63
                                               R.string.tutorials,
64
                                               R.string.about };
65

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

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

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

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

    
92
    MAX_LEVEL = max;
93
    }
94

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

    
97
  void leaveScreen(RubikActivity act)
98
    {
99

    
100
    }
101

    
102
///////////////////////////////////////////////////////////////////////////////////////////////////
103

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

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

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

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

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

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

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

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

    
137
//////////////////////////////////////////////////////////////////////////////////////////////////
138

    
139
  private void setupObjectButton(final RubikActivity act, final float width)
140
    {
141
    final int margin  = (int)(width*RubikActivity.MARGIN);
142
    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);
143

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

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

    
162
///////////////////////////////////////////////////////////////////////////////////////////////////
163

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

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

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

    
190
///////////////////////////////////////////////////////////////////////////////////////////////////
191

    
192
  private void setupMenuButton(final RubikActivity act, final float width)
193
    {
194
    final int margin  = (int)(width*RubikActivity.MARGIN);
195
    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);
196

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

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

    
214
///////////////////////////////////////////////////////////////////////////////////////////////////
215

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

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

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

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

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

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

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

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

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

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

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

    
291
      nextInRow[row]++;
292

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

    
297
///////////////////////////////////////////////////////////////////////////////////////////////////
298

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

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

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

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

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

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

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

    
338
///////////////////////////////////////////////////////////////////////////////////////////////////
339

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

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

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

    
352
    adjustLevels(act);
353
    }
354

    
355
///////////////////////////////////////////////////////////////////////////////////////////////////
356

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

    
390
///////////////////////////////////////////////////////////////////////////////////////////////////
391

    
392
  void setupSolveButton(final RubikActivity act, final float width)
393
    {
394
    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);
395
    mSolveButton = new TransparentImageButton(act, icon, width,LinearLayout.LayoutParams.MATCH_PARENT);
396

    
397
    mSolveButton.setOnClickListener( new View.OnClickListener()
398
      {
399
      @Override
400
      public void onClick(View v)
401
        {
402
        act.getControl().solveObject();
403
        mMovesController.clearMoves(act);
404
        }
405
      });
406
    }
407

    
408
///////////////////////////////////////////////////////////////////////////////////////////////////
409

    
410
  public void savePreferences(SharedPreferences.Editor editor)
411
    {
412
    editor.putString("statePlay_objName", mObject.name() );
413

    
414
    if( mObjectPopup!=null )
415
      {
416
      mObjectPopup.dismiss();
417
      mObjectPopup = null;
418
      }
419

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

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

    
433
///////////////////////////////////////////////////////////////////////////////////////////////////
434

    
435
  public void restorePreferences(SharedPreferences preferences)
436
    {
437
    String objName= preferences.getString("statePlay_objName", DEF_OBJECT.name() );
438
    int ordinal = ObjectType.getOrdinal(objName);
439
    mObject = ordinal>=0 ? ObjectType.values()[ordinal] : DEF_OBJECT;
440
    }
441

    
442
///////////////////////////////////////////////////////////////////////////////////////////////////
443

    
444
  public boolean setObject(RubikActivity act, ObjectType obj)
445
    {
446
    if( mObject!=obj )
447
      {
448
      mObject = obj;
449
      if( mPlayLayout!=null ) adjustLevels(act);
450
      return true;
451
      }
452

    
453
    return false;
454
    }
455

    
456
///////////////////////////////////////////////////////////////////////////////////////////////////
457
// work around lame bugs in Android's version <= 10 pop-up and split-screen modes
458

    
459
  private void displayPopup(RubikActivity act, View view, PopupWindow window, int w, int h, int xoff, int yoff)
460
    {
461
    View topLayout = act.findViewById(R.id.relativeLayout);
462
    boolean isFullScreen;
463

    
464
    if( topLayout!=null )
465
      {
466
      topLayout.getLocationOnScreen(mLocation);
467
      isFullScreen = (mLocation[1]==0);
468
      }
469
    else
470
      {
471
      isFullScreen = true;
472
      }
473

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

    
488
      window.showAsDropDown(view);
489
      window.update(x,y,w,h);
490
      }
491
    }
492

    
493
///////////////////////////////////////////////////////////////////////////////////////////////////
494

    
495
  private void adjustLevels(final RubikActivity act)
496
    {
497
    int dbLevel = getDBLevel(mObject);
498
    int numScrambles = ObjectType.getNumScramble(mObject.ordinal());
499
    int numLevel = Math.min(dbLevel, LEVELS_SHOWN);
500
    String[] levels = new String[numLevel];
501

    
502
    for(int i=0; i<numLevel-1; i++)
503
      {
504
      levels[i] = act.getString(R.string.lv_placeholder,i+1);
505
      }
506

    
507
    if( numLevel>0 )
508
      {
509
      levels[numLevel-1] = act.getString(R.string.level_full);
510
      }
511

    
512
    if( mLevelValue>dbLevel || mLevelValue<1 ||
513
       (mLevelValue<dbLevel || mLevelValue>LEVELS_SHOWN ) )
514
      {
515
      mLevelValue=1;
516
      }
517

    
518
    float width  = act.getScreenWidthInPixels();
519
    int margin   = (int)(width*RubikActivity.MARGIN);
520
    int padding  = (int)(width*RubikActivity.PADDING);
521
    int butWidth = mPlayLayoutWidth - 2*padding;
522
    int butHeight= (int)mMenuItemSize;
523
    int lastButH = (int)(mMenuItemSize*LAST_BUTTON) ;
524

    
525
    LinearLayout.LayoutParams pM = new LinearLayout.LayoutParams( butWidth, butHeight );
526
    pM.setMargins(margin, 0, margin, margin);
527
    LinearLayout.LayoutParams pT = new LinearLayout.LayoutParams( butWidth, butHeight );
528
    pT.setMargins(margin, margin, margin, margin);
529
    LinearLayout.LayoutParams pB = new LinearLayout.LayoutParams( butWidth, lastButH  );
530
    pB.setMargins(margin, margin, margin, 2*margin);
531

    
532
    mPlayLayout.removeAllViews();
533

    
534
    RubikScores scores = RubikScores.getInstance();
535

    
536
    for(int i=0; i<numLevel; i++)
537
      {
538
      final int level     = i<numLevel-1 ? i+1 : dbLevel;
539
      final int scrambles = i<numLevel-1 ? i+1 : numScrambles;
540
      Button button = new Button(act);
541
      button.setLayoutParams(i==0 ? pT : (i==numLevel-1 ? pB : pM));
542
      button.setText(levels[i]);
543
      button.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
544

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

    
548
      button.setOnClickListener( new View.OnClickListener()
549
        {
550
        @Override
551
        public void onClick(View v)
552
          {
553
          ObjectControl control = act.getControl();
554

    
555
          if(control.isUINotBlocked())
556
            {
557
            if( mPlayPopup!=null ) mPlayPopup.dismiss();
558
            mLevelValue = level;
559
            control.scrambleObject(scrambles);
560
            }
561
          }
562
        });
563

    
564
      mPlayLayout.addView(button);
565
      }
566
    }
567

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

    
574
  public static int getDBLevel(ObjectType object)
575
    {
576
    switch(object)
577
      {
578
      case CUBE_3: return 16;
579
      case CUBE_4: return 20;
580
      case CUBE_5: return 24;
581
      case PYRA_4: return 14;
582
      case PYRA_5: return 20;
583
      case MEGA_5: return 35;
584
      case DIAM_2: return 10;
585
      case DIAM_3: return 18;
586
      case REDI_3: return 14;
587
      case HELI_3: return 18;
588
      case SKEW_3: return 17;
589
      case REX_3 : return 16;
590
      case MIRR_3: return 16;
591
      default    : return ObjectType.getNumScramble(object.ordinal());
592
      }
593
    }
594

    
595
///////////////////////////////////////////////////////////////////////////////////////////////////
596

    
597
  public int getLevel()
598
    {
599
    return mLevelValue;
600
    }
601

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

    
604
  public ObjectType getObject()
605
    {
606
    return mObject;
607
    }
608
  }
(5-5/10)