Revision d12bb11b
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/patterns/RubikPattern.java | ||
---|---|---|
158 | 158 |
private int[][] moves; |
159 | 159 |
private int curMove; |
160 | 160 |
private int numMove; |
161 |
|
|
162 | 161 |
private boolean mCanRotate; |
163 |
private RubikObject mObject; |
|
164 | 162 |
|
165 | 163 |
///////////////////////////////////////////////////////////// |
166 | 164 |
|
... | ... | |
223 | 221 |
curMove++; |
224 | 222 |
RubikObject object = post.getObject(); |
225 | 223 |
|
226 |
if( curMove>numMove ) |
|
227 |
{ |
|
228 |
curMove= 0; |
|
229 |
object.initializeObject(null); |
|
230 |
} |
|
231 |
else |
|
224 |
if( mCanRotate ) |
|
232 | 225 |
{ |
233 |
if( mCanRotate ) |
|
226 |
if( curMove>numMove ) |
|
227 |
{ |
|
228 |
curMove= 0; |
|
229 |
post.initializeObject(null); |
|
230 |
} |
|
231 |
else |
|
234 | 232 |
{ |
235 | 233 |
mCanRotate = false; |
236 |
mObject = object; |
|
237 | 234 |
|
238 | 235 |
int axis =moves[curMove-1][0]; |
239 | 236 |
int rowBitmap=moves[curMove-1][1]; |
... | ... | |
243 | 240 |
|
244 | 241 |
post.addRotation(this, axis, rowBitmap, angle, numRot*DURATION_MILLIS); |
245 | 242 |
} |
246 |
else |
|
247 |
{ |
|
248 |
android.util.Log.e("pattern", "failed to make Move!"); |
|
249 |
|
|
250 |
curMove--; |
|
251 |
} |
|
243 |
} |
|
244 |
else |
|
245 |
{ |
|
246 |
android.util.Log.e("pattern", "failed to make Move!"); |
|
247 |
curMove--; |
|
252 | 248 |
} |
253 | 249 |
} |
254 | 250 |
|
... | ... | |
259 | 255 |
curMove--; |
260 | 256 |
RubikObject object = post.getObject(); |
261 | 257 |
|
262 |
if( curMove<0 ) |
|
263 |
{ |
|
264 |
curMove=numMove; |
|
265 |
object.initializeObject(moves); |
|
266 |
} |
|
267 |
else |
|
258 |
if( mCanRotate ) |
|
268 | 259 |
{ |
269 |
if( mCanRotate ) |
|
260 |
if( curMove<0 ) |
|
261 |
{ |
|
262 |
curMove=numMove; |
|
263 |
post.initializeObject(moves); |
|
264 |
} |
|
265 |
else |
|
270 | 266 |
{ |
271 | 267 |
mCanRotate = false; |
272 |
mObject = object; |
|
273 | 268 |
|
274 | 269 |
int axis =moves[curMove][0]; |
275 | 270 |
int rowBitmap=moves[curMove][1]; |
... | ... | |
279 | 274 |
|
280 | 275 |
post.addRotation(this, axis, rowBitmap, -angle, numRot*DURATION_MILLIS); |
281 | 276 |
} |
282 |
else
|
|
283 |
{
|
|
284 |
android.util.Log.e("pattern", "failed to back Move!");
|
|
285 |
curMove++;
|
|
286 |
}
|
|
277 |
}
|
|
278 |
else
|
|
279 |
{
|
|
280 |
android.util.Log.e("pattern", "failed to back Move!");
|
|
281 |
curMove++;
|
|
287 | 282 |
} |
288 | 283 |
} |
289 | 284 |
|
... | ... | |
298 | 293 |
|
299 | 294 |
public void onActionFinished(final long effectID) |
300 | 295 |
{ |
301 |
mObject.removeRotationNow(); |
|
302 | 296 |
mCanRotate = true; |
303 | 297 |
} |
304 | 298 |
} |
Also available in: Unified diff
Bugfixes - do more stuff 'post render'