Revision d36d8517
Added by Leszek Koltunski about 2 years ago
src/main/java/org/distorted/config/ConfigActivity.java | ||
---|---|---|
180 | 180 |
if( mObjectOrdinal>=0 && mObjectOrdinal< RubikObjectList.getNumObjects() ) |
181 | 181 |
{ |
182 | 182 |
RubikObject object = RubikObjectList.getObject(mObjectOrdinal); |
183 |
changeIfDifferent(object,view.getObjectControl()); |
|
183 |
changeIfDifferent(object,mObjectOrdinal,view.getObjectControl());
|
|
184 | 184 |
} |
185 | 185 |
} |
186 | 186 |
|
... | ... | |
203 | 203 |
|
204 | 204 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
205 | 205 |
|
206 |
private void changeIfDifferent(RubikObject object,ObjectControl control) |
|
206 |
private void changeIfDifferent(RubikObject object,int ordinal,ObjectControl control)
|
|
207 | 207 |
{ |
208 | 208 |
if( object!=null ) |
209 | 209 |
{ |
210 |
int ordinal = object.getOrdinal(); |
|
211 | 210 |
int meshState = object.getMeshState(); |
212 | 211 |
InputStream jsonStream = object.getObjectStream(this); |
213 | 212 |
InputStream meshStream = object.getMeshStream(this); |
... | ... | |
226 | 225 |
RubikObject object = RubikObjectList.getObject(ordinal); |
227 | 226 |
ConfigSurfaceView view = findViewById(R.id.configSurfaceView); |
228 | 227 |
ObjectControl control = view.getObjectControl(); |
229 |
changeIfDifferent(object,control); |
|
228 |
changeIfDifferent(object,ordinal,control);
|
|
230 | 229 |
} |
231 | 230 |
|
232 | 231 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
233 | 232 |
|
234 |
public void changeMeshState(RubikObject object) |
|
233 |
public void changeMeshState(RubikObject object, int ordinal)
|
|
235 | 234 |
{ |
236 | 235 |
if( object!=null ) |
237 | 236 |
{ |
238 | 237 |
ConfigSurfaceView view = findViewById(R.id.configSurfaceView); |
239 | 238 |
ObjectControl control = view.getObjectControl(); |
240 | 239 |
|
241 |
int ordinal = object.getOrdinal(); |
|
242 | 240 |
int meshState = object.getMeshState(); |
243 | 241 |
InputStream jsonStream = object.getObjectStream(this); |
244 | 242 |
InputStream meshStream = object.getMeshStream(this); |
Also available in: Unified diff
Refactor RubikObject in preparation for creating RubikObjects from DownloadedObjects.