Project

General

Profile

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

magiccube / src / main / java / org / distorted / screens / RubikScreenPlay.java @ 55e6be1d

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.Bundle;
26
import android.util.TypedValue;
27
import android.view.Gravity;
28
import android.view.LayoutInflater;
29
import android.view.View;
30
import android.widget.Button;
31
import android.widget.GridLayout;
32
import android.widget.ImageButton;
33
import android.widget.LinearLayout;
34
import android.widget.PopupWindow;
35

    
36
import org.distorted.dialogs.RubikDialogAbout;
37
import org.distorted.dialogs.RubikDialogPattern;
38
import org.distorted.dialogs.RubikDialogScores;
39
import org.distorted.dialogs.RubikDialogTutorial;
40
import org.distorted.helpers.TransparentButton;
41
import org.distorted.helpers.TransparentImageButton;
42
import org.distorted.main.R;
43
import org.distorted.main.RubikActivity;
44
import org.distorted.main.RubikPreRender;
45
import org.distorted.objects.ObjectList;
46
import org.distorted.network.RubikScores;
47

    
48
///////////////////////////////////////////////////////////////////////////////////////////////////
49

    
50
public class RubikScreenPlay extends RubikScreenBase
51
  {
52
  public static final int LEVELS_SHOWN = 10;
53
  public static final int DEF_OBJECT= ObjectList.CUBE.ordinal();
54
  public static final int DEF_SIZE  =  3;
55

    
56
  private static final int[] BUTTON_LABELS = { R.string.scores,
57
                                               R.string.patterns,
58
                                           //    R.string.control,
59
                                               R.string.solver,
60
                                               R.string.tutorials,
61
                                               R.string.about };
62

    
63
  private static final int NUM_BUTTONS = BUTTON_LABELS.length;
64
  private static final float LAST_BUTTON = 1.5f;
65

    
66
  private ImageButton mObjButton, mMenuButton, mSolveButton;
67
  private Button mPlayButton;
68
  private PopupWindow mObjectPopup, mMenuPopup, mPlayPopup;
69
  private int mObject = DEF_OBJECT;
70
  private int mSize   = DEF_SIZE;
71
  private int mObjectSize, mMenuLayoutWidth, mMenuLayoutHeight, mPlayLayoutWidth;
72
  private int mLevelValue;
73
  private float mButtonSize, mMenuItemSize, mMenuTextSize;
74
  private int mColCount, mRowCount;
75
  private LinearLayout mPlayLayout;
76

    
77
///////////////////////////////////////////////////////////////////////////////////////////////////
78

    
79
  void leaveScreen(RubikActivity act)
80
    {
81

    
82
    }
83

    
84
///////////////////////////////////////////////////////////////////////////////////////////////////
85

    
86
  void enterScreen(final RubikActivity act)
87
    {
88
    float width = act.getScreenWidthInPixels();
89

    
90
    mMenuTextSize = width*RubikActivity.MENU_MED_TEXT_SIZE;
91
    mButtonSize   = width*RubikActivity.BUTTON_TEXT_SIZE;
92
    mMenuItemSize = width*RubikActivity.MENU_ITEM_SIZE;
93

    
94
    mRowCount = ObjectList.getRowCount();
95
    mColCount = ObjectList.getColumnCount();
96

    
97
    // TOP ////////////////////////////
98
    LinearLayout layoutTop = act.findViewById(R.id.upperBar);
99
    layoutTop.removeAllViews();
100

    
101
    setupObjectWindow(act,width);
102
    setupObjectButton(act,width);
103
    layoutTop.addView(mObjButton);
104

    
105
    setupMenuWindow(act,width);
106
    setupMenuButton(act,width);
107
    layoutTop.addView(mMenuButton);
108

    
109
    setupPlayWindow(act,width);
110
    setupPlayButton(act,width);
111
    layoutTop.addView(mPlayButton);
112

    
113
    setupSolveButton(act,width);
114
    createBottomPane(act,width,mSolveButton);
115
    }
116

    
117
///////////////////////////////////////////////////////////////////////////////////////////////////
118

    
119
  private void setupObjectButton(final RubikActivity act, final float width)
120
    {
121
    final int margin  = (int)(width*RubikActivity.MARGIN);
122
    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);
123
    mObjButton = new TransparentImageButton(act, icon, width,LinearLayout.LayoutParams.MATCH_PARENT);
124

    
125
    mObjButton.setOnClickListener( new View.OnClickListener()
126
      {
127
      @Override
128
      public void onClick(View view)
129
        {
130
        if(act.getPreRender().isUINotBlocked())
131
          {
132
          if( mObjectPopup==null )
133
            {
134
            // I completely don't understand it, but Firebase says occasionally mObjectPopup is null here. Recreate.
135
            float width = act.getScreenWidthInPixels();
136
            setupObjectWindow(act,width);
137
            }
138

    
139
          mObjectPopup.setFocusable(false);
140
          mObjectPopup.update();
141

    
142
          View popupView = mObjectPopup.getContentView();
143
          popupView.setSystemUiVisibility(RubikActivity.FLAGS);
144

    
145
          mObjectPopup.showAsDropDown(view, margin, margin);
146
          mObjectPopup.update(view, mObjectSize*mColCount, mObjectSize*mRowCount);
147

    
148
          mObjectPopup.setFocusable(true);
149
          mObjectPopup.update();
150
          }
151
        }
152
      });
153
    }
154

    
155
///////////////////////////////////////////////////////////////////////////////////////////////////
156

    
157
  private void setupPlayButton(final RubikActivity act, final float width)
158
    {
159
    final int margin  = (int)(width*RubikActivity.MARGIN);
160
    mPlayButton = new TransparentButton(act, R.string.play, mButtonSize, width);
161

    
162
    mPlayButton.setOnClickListener( new View.OnClickListener()
163
      {
164
      @Override
165
      public void onClick(View view)
166
        {
167
        if(act.getPreRender().isUINotBlocked())
168
          {
169
          if( mPlayPopup==null )
170
            {
171
            // I completely don't understand it, but Firebase says occasionally mPlayPopup is null here. Recreate.
172
            float width = act.getScreenWidthInPixels();
173
            setupPlayWindow(act,width);
174
            }
175

    
176
          mPlayPopup.setFocusable(false);
177
          mPlayPopup.update();
178

    
179
          View popupView = mPlayPopup.getContentView();
180
          popupView.setSystemUiVisibility(RubikActivity.FLAGS);
181

    
182
          final int sizeIndex = ObjectList.getSizeIndex(mObject,mSize);
183
          final int dbLevel = ObjectList.getDBLevel(mObject, sizeIndex);
184
          final int levelsShown = Math.min(dbLevel,LEVELS_SHOWN);
185

    
186
          mPlayPopup.showAsDropDown(view, margin, margin);
187
          mPlayPopup.update(view, mPlayLayoutWidth, (int)(levelsShown*(mMenuItemSize+margin)+3*margin+mMenuItemSize*(LAST_BUTTON-1.0f)));
188
          mPlayPopup.setFocusable(true);
189
          mPlayPopup.update();
190
          }
191
        }
192
      });
193
    }
194

    
195
///////////////////////////////////////////////////////////////////////////////////////////////////
196

    
197
  private void setupMenuButton(final RubikActivity act, final float width)
198
    {
199
    final int margin  = (int)(width*RubikActivity.MARGIN);
200
    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);
201
    mMenuButton = new TransparentImageButton(act, icon, width,LinearLayout.LayoutParams.MATCH_PARENT);
202

    
203
    mMenuButton.setOnClickListener( new View.OnClickListener()
204
      {
205
      @Override
206
      public void onClick(View view)
207
        {
208
        if(act.getPreRender().isUINotBlocked())
209
          {
210
          if( mMenuPopup==null )
211
            {
212
            // I completely don't understand it, but Firebase says occasionally mMenuPopup is null here. Recreate.
213
            float width = act.getScreenWidthInPixels();
214
            setupMenuWindow(act,width);
215
            }
216

    
217
          mMenuPopup.setFocusable(false);
218
          mMenuPopup.update();
219

    
220
          View popupView = mMenuPopup.getContentView();
221
          popupView.setSystemUiVisibility(RubikActivity.FLAGS);
222

    
223
          mMenuPopup.showAsDropDown(view, (int)(-width/12), margin, Gravity.CENTER);
224
          mMenuPopup.update(view, mMenuLayoutWidth, mMenuLayoutHeight);
225
          mMenuPopup.setFocusable(true);
226
          mMenuPopup.update();
227
          }
228
        }
229
      });
230
    }
231

    
232
///////////////////////////////////////////////////////////////////////////////////////////////////
233

    
234
  private void setupObjectWindow(final RubikActivity act, final float width)
235
    {
236
    LayoutInflater layoutInflater = (LayoutInflater)act.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
237
    final View layout = layoutInflater.inflate(R.layout.popup_objects, null);
238
    GridLayout objectGrid = layout.findViewById(R.id.objectGrid);
239

    
240
    int[] indices = ObjectList.getIndices();
241

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

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

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

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

    
260
    mObjectPopup = new PopupWindow(act);
261
    mObjectPopup.setContentView(layout);
262
    mObjectPopup.setFocusable(true);
263
    int icon = RubikActivity.getDrawable(R.drawable.ui_small_cube2,R.drawable.ui_medium_cube2, R.drawable.ui_big_cube2, R.drawable.ui_huge_cube2);
264

    
265
    BitmapDrawable bd = (BitmapDrawable) act.getResources().getDrawable(icon);
266
    int cubeWidth = bd.getIntrinsicWidth();
267
    int margin = (int)(width*RubikActivity.LARGE_MARGIN);
268
    mObjectSize = (int)(cubeWidth + 2*margin + 0.5f);
269

    
270
    for(int object=0; object< ObjectList.NUM_OBJECTS; object++)
271
      {
272
      final ObjectList list = ObjectList.getObject(object);
273
      final int[] sizes = list.getSizes();
274
      int[] icons = list.getIconIDs();
275
      int len = sizes.length;
276
      final int obj = object;
277
      int row = indices[object];
278

    
279
      for(int i=0; i<len; i++)
280
        {
281
        final int index = i;
282

    
283
        ImageButton button = new ImageButton(act);
284
        button.setBackgroundResource(icons[i]);
285
        button.setOnClickListener( new View.OnClickListener()
286
          {
287
          @Override
288
          public void onClick(View v)
289
            {
290
            if( act.getPreRender().isUINotBlocked() && ScreenList.getCurrentScreen()== ScreenList.PLAY )
291
              {
292
              mObject = obj;
293
              mSize   = sizes[index];
294
              act.changeObject(list,sizes[index], true);
295
              adjustLevels(act);
296
              mController.clearMoves();
297
              }
298

    
299
            mObjectPopup.dismiss();
300
            }
301
          });
302

    
303
        GridLayout.LayoutParams params = new GridLayout.LayoutParams(rowSpecs[row],colSpecs[nextInRow[row]]);
304
        params.bottomMargin = margin;
305
        params.topMargin    = margin;
306
        params.leftMargin   = margin;
307
        params.rightMargin  = margin;
308

    
309
        nextInRow[row]++;
310

    
311
        objectGrid.addView(button, params);
312
        }
313
      }
314
    }
315

    
316
///////////////////////////////////////////////////////////////////////////////////////////////////
317

    
318
  private void setupMenuWindow(final RubikActivity act, final float width)
319
    {
320
    LayoutInflater layoutInflater = (LayoutInflater)act.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
321
    final View layout = layoutInflater.inflate(R.layout.popup_menu, null);
322
    LinearLayout menuLayout = layout.findViewById(R.id.menuGrid);
323

    
324
    mMenuPopup = new PopupWindow(act);
325
    mMenuPopup.setContentView(layout);
326
    mMenuPopup.setFocusable(true);
327
    int margin  = (int)(width*RubikActivity.MARGIN);
328
    int padding = (int)(width*RubikActivity.PADDING);
329

    
330
    mMenuLayoutWidth = (int)(width/2);
331
    mMenuLayoutHeight= (int)(2*margin + NUM_BUTTONS*(mMenuItemSize+margin));
332

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

    
335
    for(int i=0; i<NUM_BUTTONS; i++)
336
      {
337
      final int but = i;
338
      Button button = new Button(act);
339
      button.setLayoutParams(p);
340
      button.setText(BUTTON_LABELS[i]);
341
      button.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
342

    
343
      button.setOnClickListener( new View.OnClickListener()
344
        {
345
        @Override
346
        public void onClick(View v)
347
          {
348
          mMenuPopup.dismiss();
349
          MenuAction(act,but);
350
          }
351
        });
352

    
353
      menuLayout.addView(button);
354
      }
355
    }
356

    
357
///////////////////////////////////////////////////////////////////////////////////////////////////
358

    
359
  private void setupPlayWindow(final RubikActivity act, final float width)
360
    {
361
    LayoutInflater layoutInflater = (LayoutInflater)act.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
362
    final View layout = layoutInflater.inflate(R.layout.popup_play, null);
363
    mPlayLayout = layout.findViewById(R.id.playGrid);
364

    
365
    mPlayLayoutWidth = (int)(width*0.4f);
366

    
367
    mPlayPopup = new PopupWindow(act);
368
    mPlayPopup.setContentView(layout);
369
    mPlayPopup.setFocusable(true);
370

    
371
    adjustLevels(act);
372
    }
373

    
374
///////////////////////////////////////////////////////////////////////////////////////////////////
375

    
376
  private void MenuAction(RubikActivity act, int button)
377
    {
378
    switch(button)
379
      {
380
      case 0: RubikScreenPlay play = (RubikScreenPlay) ScreenList.PLAY.getScreenClass();
381
              int object = play.getObject();
382
              int size   = play.getSize();
383
              int sizeIndex = ObjectList.getSizeIndex(object,size);
384
              Bundle sBundle = new Bundle();
385
              sBundle.putInt("tab", ObjectList.pack(object,sizeIndex) );
386
              sBundle.putBoolean("submitting", false);
387
              RubikDialogScores scores = new RubikDialogScores();
388
              scores.setArguments(sBundle);
389
              scores.show(act.getSupportFragmentManager(), null);
390
              break;
391
      case 1: RubikDialogPattern pDiag = new RubikDialogPattern();
392
              Bundle pBundle = new Bundle();
393
              int pOrd = getPatternOrdinal();
394
              pBundle.putInt("tab", pOrd );
395
              pDiag.setArguments(pBundle);
396
              pDiag.show( act.getSupportFragmentManager(), RubikDialogPattern.getDialogTag() );
397
              break;
398
/*
399
      case 2: RubikControl control = RubikControl.getInstance();
400
              control.animateAll(act);
401
              break;
402
 */
403
      case 2: ScreenList.switchScreen(act, ScreenList.SVER);
404
              break;
405
      case 3: RubikDialogTutorial tDiag = new RubikDialogTutorial();
406
              Bundle tBundle = new Bundle();
407
              int tOrd = getTutorialOrdinal();
408
              tBundle.putInt("tab", tOrd );
409
              tDiag.setArguments(tBundle);
410
              tDiag.show( act.getSupportFragmentManager(), RubikDialogTutorial.getDialogTag() );
411
              break;
412
      case 4: RubikDialogAbout aDiag = new RubikDialogAbout();
413
              aDiag.show(act.getSupportFragmentManager(), null);
414
              break;
415
      }
416
    }
417

    
418
///////////////////////////////////////////////////////////////////////////////////////////////////
419

    
420
  void setupSolveButton(final RubikActivity act, final float width)
421
    {
422
    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);
423
    mSolveButton = new TransparentImageButton(act, icon, width,LinearLayout.LayoutParams.MATCH_PARENT);
424

    
425
    mSolveButton.setOnClickListener( new View.OnClickListener()
426
      {
427
      @Override
428
      public void onClick(View v)
429
        {
430
        act.getPreRender().solveObject();
431
        mController.clearMoves();
432
        }
433
      });
434
    }
435

    
436
///////////////////////////////////////////////////////////////////////////////////////////////////
437

    
438
  public void savePreferences(SharedPreferences.Editor editor)
439
    {
440
    editor.putInt("statePlay_object", mObject);
441
    editor.putInt("statePlay_size"  , mSize);
442

    
443
    if( mObjectPopup!=null )
444
      {
445
      mObjectPopup.dismiss();
446
      mObjectPopup = null;
447
      }
448

    
449
    if( mMenuPopup!=null )
450
      {
451
      mMenuPopup.dismiss();
452
      mMenuPopup = null;
453
      }
454

    
455
    if( mPlayPopup!=null )
456
      {
457
      mPlayPopup.dismiss();
458
      mPlayPopup = null;
459
      }
460
    }
461

    
462
///////////////////////////////////////////////////////////////////////////////////////////////////
463

    
464
  public void restorePreferences(SharedPreferences preferences)
465
    {
466
    mObject= preferences.getInt("statePlay_object", DEF_OBJECT);
467
    mSize  = preferences.getInt("statePlay_size"  , DEF_SIZE  );
468

    
469
    int sizeIndex = ObjectList.getSizeIndex(mObject,mSize);
470
    int dbLevel = ObjectList.getDBLevel(mObject, sizeIndex);
471

    
472
    // This means the app has been upgraded to a new version which swapped the
473
    // Object for a new one with larger sizeIndex and now getMaxLevel() returns
474
    // 0. Reset the object to default, otherwise we'll get a crash later on.
475

    
476
    if( dbLevel==0 )
477
      {
478
      mObject = DEF_OBJECT;
479
      mSize   = DEF_SIZE;
480
      }
481
    }
482

    
483
///////////////////////////////////////////////////////////////////////////////////////////////////
484

    
485
  public boolean setObjectAndSize(RubikActivity act, ObjectList obj, int size)
486
    {
487
    if( mObject!=obj.ordinal() || mSize != size )
488
      {
489
      boolean success = false;
490

    
491
      for( int s: obj.getSizes() )
492
        if( s==size )
493
          {
494
          success = true;
495
          break;
496
          }
497

    
498
      if( success )
499
        {
500
        mObject = obj.ordinal();
501
        mSize   = size;
502

    
503
        if( mPlayLayout!=null ) adjustLevels(act);
504
        }
505

    
506
      return success;
507
      }
508

    
509
    return true;
510
    }
511

    
512
///////////////////////////////////////////////////////////////////////////////////////////////////
513

    
514
  private void adjustLevels(final RubikActivity act)
515
    {
516
    int sizeIndex = ObjectList.getSizeIndex(mObject,mSize);
517
    int dbLevel = ObjectList.getDBLevel(mObject, sizeIndex);
518
    int numScrambles = ObjectList.getNumScramble(mObject, sizeIndex);
519
    int numLevel = Math.min(dbLevel, LEVELS_SHOWN);
520
    String[] levels = new String[numLevel];
521

    
522
    for(int i=0; i<numLevel-1; i++)
523
      {
524
      levels[i] = act.getString(R.string.lv_placeholder,i+1);
525
      }
526

    
527
    if( numLevel>0 )
528
      {
529
      levels[numLevel-1] = act.getString(R.string.level_full);
530
      }
531

    
532
    if( mLevelValue>dbLevel || mLevelValue<1 ||
533
       (mLevelValue<dbLevel || mLevelValue>LEVELS_SHOWN ) )
534
      {
535
      mLevelValue=1;
536
      }
537

    
538
    float width  = act.getScreenWidthInPixels();
539
    int margin   = (int)(width*RubikActivity.MARGIN);
540
    int padding  = (int)(width*RubikActivity.PADDING);
541
    int butWidth = mPlayLayoutWidth - 2*padding;
542
    int butHeight= (int)mMenuItemSize;
543
    int lastButH = (int)(mMenuItemSize*LAST_BUTTON) ;
544

    
545
    LinearLayout.LayoutParams pM = new LinearLayout.LayoutParams( butWidth, butHeight );
546
    pM.setMargins(margin, 0, margin, margin);
547
    LinearLayout.LayoutParams pT = new LinearLayout.LayoutParams( butWidth, butHeight );
548
    pT.setMargins(margin, margin, margin, margin);
549
    LinearLayout.LayoutParams pB = new LinearLayout.LayoutParams( butWidth, lastButH  );
550
    pB.setMargins(margin, margin, margin, 2*margin);
551

    
552
    mPlayLayout.removeAllViews();
553

    
554
    RubikScores scores = RubikScores.getInstance();
555

    
556
    for(int i=0; i<numLevel; i++)
557
      {
558
      final int level     = i<numLevel-1 ? i+1 : dbLevel;
559
      final int scrambles = i<numLevel-1 ? i+1 : numScrambles;
560
      Button button = new Button(act);
561
      button.setLayoutParams(i==0 ? pT : (i==numLevel-1 ? pB : pM));
562
      button.setText(levels[i]);
563
      button.setTextSize(TypedValue.COMPLEX_UNIT_PX, mMenuTextSize);
564

    
565
      int icon = scores.isSolved(mObject, sizeIndex, level-1) ? R.drawable.ui_solved : R.drawable.ui_notsolved;
566
      button.setCompoundDrawablesWithIntrinsicBounds(icon,0,0,0);
567

    
568
      button.setOnClickListener( new View.OnClickListener()
569
        {
570
        @Override
571
        public void onClick(View v)
572
          {
573
          RubikPreRender pre = act.getPreRender();
574

    
575
          if(pre.isUINotBlocked())
576
            {
577
            mPlayPopup.dismiss();
578
            mLevelValue = level;
579
            pre.scrambleObject(scrambles);
580
            }
581
          }
582
        });
583

    
584
      mPlayLayout.addView(button);
585
      }
586
    }
587

    
588
///////////////////////////////////////////////////////////////////////////////////////////////////
589

    
590
  public int getLevel()
591
    {
592
    return mLevelValue;
593
    }
594

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

    
597
  public int getObject()
598
    {
599
    return mObject;
600
    }
601

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

    
604
  public int getSize()
605
    {
606
    return mSize;
607
    }
608
  }
(5-5/10)