Revision 8cccfb10
Added by Leszek Koltunski almost 4 years ago
src/main/java/org/distorted/objects/RubikObjectList.java | ||
---|---|---|
54 | 54 |
; |
55 | 55 |
|
56 | 56 |
public static final int NUM_OBJECTS = values().length; |
57 |
public static final int MAX_SIZE;
|
|
57 |
public static final int MAX_NUM_OBJECTS;
|
|
58 | 58 |
public static final int MAX_LEVEL; |
59 |
public static final int MAX_OBJECT_SIZE; |
|
59 | 60 |
|
60 | 61 |
private final int[] mObjectSizes, mMaxLevels, mIconIDs; |
61 | 62 |
private final Class<? extends RubikObject> mObjectClass; |
... | ... | |
66 | 67 |
static |
67 | 68 |
{ |
68 | 69 |
mNumAll = 0; |
69 |
int size, i = 0;
|
|
70 |
int num, i = 0;
|
|
70 | 71 |
objects = new RubikObjectList[NUM_OBJECTS]; |
71 |
int maxSize = Integer.MIN_VALUE; |
|
72 |
int maxLevel = Integer.MIN_VALUE; |
|
72 |
int maxNum = Integer.MIN_VALUE; |
|
73 |
int maxLevel= Integer.MIN_VALUE; |
|
74 |
int maxSize = Integer.MIN_VALUE; |
|
73 | 75 |
|
74 | 76 |
for(RubikObjectList object: RubikObjectList.values()) |
75 | 77 |
{ |
76 | 78 |
objects[i] = object; |
77 | 79 |
i++; |
78 |
size = object.mObjectSizes.length;
|
|
79 |
mNumAll += size;
|
|
80 |
if( size> maxSize ) maxSize = size;
|
|
80 |
num = object.mObjectSizes.length;
|
|
81 |
mNumAll += num;
|
|
82 |
if( num> maxNum ) maxNum = num;
|
|
81 | 83 |
|
82 |
for(int j=0; j<size; j++)
|
|
84 |
for(int j=0; j<num; j++)
|
|
83 | 85 |
{ |
84 | 86 |
if( object.mMaxLevels[j] > maxLevel ) maxLevel = object.mMaxLevels[j]; |
87 |
if( object.mObjectSizes[j] > maxSize) maxSize = object.mObjectSizes[j]; |
|
85 | 88 |
} |
86 | 89 |
} |
87 | 90 |
|
88 |
MAX_SIZE = maxSize; |
|
89 |
MAX_LEVEL= maxLevel; |
|
91 |
MAX_NUM_OBJECTS = maxNum; |
|
92 |
MAX_LEVEL = maxLevel; |
|
93 |
MAX_OBJECT_SIZE = maxSize; |
|
90 | 94 |
} |
91 | 95 |
|
92 | 96 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
More progreess porting RubikCube.