Revision 5e254115
Added by Leszek Koltunski over 2 years ago
src/main/java/org/distorted/objects/TwistyBandagedAbstract.java | ||
---|---|---|
433 | 433 |
return reaches ? stickerIndex*NUM_FACES + face : NUM_STICKERS*NUM_FACES; |
434 | 434 |
} |
435 | 435 |
|
436 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
437 |
// this implements the fact that certain cubits have multiple 'centers' and this means the cubit |
|
438 |
// might span more than one layer along a given axis - i.e. that this is a bandaged puzzle. |
|
439 |
|
|
440 |
int computeBitmapFromRow(int rowBitmap, int axis) |
|
441 |
{ |
|
442 |
int bitmap, initBitmap=0; |
|
443 |
|
|
444 |
while( initBitmap!=rowBitmap ) |
|
445 |
{ |
|
446 |
initBitmap = rowBitmap; |
|
447 |
|
|
448 |
for(int cubit=0; cubit<NUM_CUBITS; cubit++) |
|
449 |
{ |
|
450 |
bitmap = CUBITS[cubit].mRotationRow[axis]; |
|
451 |
if( (rowBitmap & bitmap) != 0 ) rowBitmap |= bitmap; |
|
452 |
} |
|
453 |
} |
|
454 |
|
|
455 |
return rowBitmap; |
|
456 |
} |
|
457 |
|
|
458 | 436 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
459 | 437 |
|
460 | 438 |
float returnMultiplier() |
Also available in: Unified diff
auto-compute the bandaged status from dimension of the CENTERS. Make 'computeBitmapFromRow' generic for bandageed and not bandaged objects.