Revision 5bda8973
Added by Leszek Koltunski over 1 year ago
src/main/java/org/distorted/external/RubikNetwork.java | ||
---|---|---|
30 | 30 |
import org.distorted.objectlib.json.JsonWriter; |
31 | 31 |
import org.distorted.objects.RubikObjectList; |
32 | 32 |
|
33 |
import static org.distorted.objects.RubikObjectList.MAX_LEVEL; |
|
34 | 33 |
import static org.distorted.main.RubikActivity.SHOW_DOWNLOADED_DEBUG; |
34 |
import static org.distorted.screens.RubikScreenPlay.LEVELS_SHOWN; |
|
35 | 35 |
|
36 | 36 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
37 | 37 |
|
... | ... | |
128 | 128 |
{ |
129 | 129 |
int newNum = RubikObjectList.getNumObjects(); |
130 | 130 |
|
131 |
if( mCountry==null || newNum!=mNumObjects ) mCountry = new String[newNum][MAX_LEVEL][MAX_PLACES];
|
|
132 |
if( mName==null || newNum!=mNumObjects ) mName = new String[newNum][MAX_LEVEL][MAX_PLACES];
|
|
133 |
if( mTime==null || newNum!=mNumObjects ) mTime = new float[newNum][MAX_LEVEL][MAX_PLACES];
|
|
134 |
if( mPlaces==null || newNum!=mNumObjects ) mPlaces = new int[newNum][MAX_LEVEL];
|
|
131 |
if( mCountry==null || newNum!=mNumObjects ) mCountry = new String[newNum][LEVELS_SHOWN+1][MAX_PLACES];
|
|
132 |
if( mName==null || newNum!=mNumObjects ) mName = new String[newNum][LEVELS_SHOWN+1][MAX_PLACES];
|
|
133 |
if( mTime==null || newNum!=mNumObjects ) mTime = new float[newNum][LEVELS_SHOWN+1][MAX_PLACES];
|
|
134 |
if( mPlaces==null || newNum!=mNumObjects ) mPlaces = new int[newNum][LEVELS_SHOWN+1];
|
|
135 | 135 |
|
136 | 136 |
if( mUpdates==null ) mUpdates = new RubikUpdates(); |
137 | 137 |
|
... | ... | |
185 | 185 |
} |
186 | 186 |
|
187 | 187 |
for(int i=0; i<mNumObjects; i++) |
188 |
for(int j=0; j<MAX_LEVEL; j++)
|
|
188 |
for(int j=0; j<=LEVELS_SHOWN; j++)
|
|
189 | 189 |
{ |
190 | 190 |
mPlaces[i][j] = 0; |
191 | 191 |
} |
... | ... | |
234 | 234 |
|
235 | 235 |
if( country.equals("do") ) country = "dm"; // see RubikScores.setCountry() |
236 | 236 |
|
237 |
if(level>=0 && level<MAX_LEVEL) |
|
237 |
if( level>LEVELS_SHOWN ) level = LEVELS_SHOWN; |
|
238 |
|
|
239 |
if(level>=0) |
|
238 | 240 |
{ |
239 | 241 |
int p = mPlaces[object][level]; |
240 | 242 |
mPlaces[object][level]++; |
Also available in: Unified diff
New way to store records, comopletely independent on the number of scrambles.
Do away with the weird 'getDBLevel' thing.