Project

General

Profile

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

magiccube / src / main / java / org / distorted / magic / RubikSize.java @ dd73fdab

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.magic;
21

    
22
///////////////////////////////////////////////////////////////////////////////////////////////////
23

    
24
public enum RubikSize
25
  {
26
  SIZE2 ( R.id.rubikSize2, R.drawable.button2, R.layout.scores_tab2 ),
27
  SIZE3 ( R.id.rubikSize3, R.drawable.button3, R.layout.scores_tab3 ),
28
  SIZE4 ( R.id.rubikSize4, R.drawable.button4, R.layout.scores_tab4 ),
29
  SIZE5 ( R.id.rubikSize5, R.drawable.button5, R.layout.scores_tab5 ),
30
  ;
31

    
32
  static final int LENGTH = values().length;
33
  private final int mImageButtonID, mIconID, mLayoutID;
34
  private static final RubikSize[] sizes;
35

    
36
  static
37
    {
38
    int i = 0;
39
    sizes = new RubikSize[LENGTH];
40

    
41
    for(RubikSize size: RubikSize.values())
42
      {
43
      sizes[i] = size;
44
      i++;
45
      }
46
    }
47

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

    
50
  static RubikSize getSize(int ordinal)
51
    {
52
    return sizes[ordinal];
53
    }
54

    
55
///////////////////////////////////////////////////////////////////////////////////////////////////
56

    
57
  RubikSize(int imageID, int iconID, int layoutID)
58
    {
59
    mImageButtonID= imageID;
60
    mIconID       = iconID;
61
    mLayoutID     = layoutID;
62
    }
63

    
64
///////////////////////////////////////////////////////////////////////////////////////////////////
65

    
66
  int getImageButton()
67
    {
68
    return mImageButtonID;
69
    }
70

    
71
///////////////////////////////////////////////////////////////////////////////////////////////////
72

    
73
  int getIcon()
74
    {
75
    return mIconID;
76
    }
77

    
78
///////////////////////////////////////////////////////////////////////////////////////////////////
79

    
80
  int getLayout()
81
    {
82
    return mLayoutID;
83
    }
84
  }
(9-9/10)