Project

General

Profile

« Previous | Next » 

Revision 5cc61ae4

Added by Leszek Koltunski over 2 years ago

Further simplify ObjectType

View differences:

src/main/java/org/distorted/objectlib/main/ObjectType.java
70 70
  ;
71 71

  
72 72
  public static final int NUM_OBJECTS = values().length;
73
  public static final int MAX_SCRAMBLE,MAX_OBJECT_SIZE;
74 73

  
75 74
  private final int[] mNumLayers;
76 75
  private final int mNumScrambles;
......
83 82
    {
84 83
    int i = 0;
85 84
    objects = new ObjectType[NUM_OBJECTS];
86
    int maxScramble= Integer.MIN_VALUE;
87
    int maxSize    = Integer.MIN_VALUE;
88

  
89
    for(ObjectType object: ObjectType.values())
90
      {
91
      objects[i++] = object;
92

  
93
      if( object.mNumScrambles> maxScramble ) maxScramble= object.mNumScrambles;
94

  
95
      int len = object.mNumLayers.length;
96

  
97
      for(int j=0; j<len; j++)
98
        if( object.mNumLayers[j]>maxSize ) maxSize = object.mNumLayers[j];
99
      }
100

  
101
    MAX_SCRAMBLE    = maxScramble;
102
    MAX_OBJECT_SIZE = maxSize;
85
    for(ObjectType object: ObjectType.values()) objects[i++] = object;
103 86
    }
104 87

  
105 88
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff