magiccube / src / main / java / org / distorted / magic / RubikState.java @ 33499c56
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 RubikState |
25 |
{
|
26 |
MAIN ( null ), |
27 |
PLAY ( MAIN ), |
28 |
;
|
29 |
|
30 |
static final int LENGTH = values().length; |
31 |
private final RubikState mBack; |
32 |
private static final RubikState[] sizes; |
33 |
|
34 |
static
|
35 |
{
|
36 |
int i = 0; |
37 |
sizes = new RubikState[LENGTH]; |
38 |
|
39 |
for(RubikState size: RubikState.values()) |
40 |
{
|
41 |
sizes[i] = size; |
42 |
i++; |
43 |
}
|
44 |
}
|
45 |
|
46 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
47 |
|
48 |
static RubikState getState(int ordinal) |
49 |
{
|
50 |
return sizes[ordinal]; |
51 |
}
|
52 |
|
53 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
54 |
|
55 |
RubikState(RubikState back) |
56 |
{
|
57 |
mBack = back; |
58 |
}
|
59 |
|
60 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
61 |
|
62 |
RubikState getBack() |
63 |
{
|
64 |
return mBack; |
65 |
}
|
66 |
}
|