Project

General

Profile

« Previous | Next » 

Revision a57e6870

Added by Leszek Koltunski over 2 years ago

make numLayers into an int[] (preparation for Cuboids)
Caution: because of previous changes to cubit order in cube, the Solver is broken!

View differences:

src/main/java/org/distorted/objectlib/objects/TwistyUltimate.java
77 77

  
78 78
///////////////////////////////////////////////////////////////////////////////////////////////////
79 79

  
80
  public TwistyUltimate(int size, Static4D quat, Static3D move, DistortedTexture texture,
80
  public TwistyUltimate(int[] numL, Static4D quat, Static3D move, DistortedTexture texture,
81 81
                        MeshSquare mesh, DistortedEffects effects, Resources res, int scrWidth)
82 82
    {
83
    super(size, size, quat, move, texture, mesh, effects, res, scrWidth);
83
    super(numL, numL[0], quat, move, texture, mesh, effects, res, scrWidth);
84 84
    }
85 85

  
86 86
///////////////////////////////////////////////////////////////////////////////////////////////////
......
102 102

  
103 103
///////////////////////////////////////////////////////////////////////////////////////////////////
104 104

  
105
  protected int getResource(int numLayers)
105
  protected int getResource(int[] numLayers)
106 106
    {
107 107
    return R.raw.ulti;
108 108
    }
......
130 130

  
131 131
///////////////////////////////////////////////////////////////////////////////////////////////////
132 132

  
133
  protected int[] getSolvedQuats(int cubit, int numLayers)
133
  protected int[] getSolvedQuats(int cubit, int[] numLayers)
134 134
    {
135 135
    if( mQuats==null ) initializeQuats();
136 136
    int status = retCubitSolvedStatus(cubit,numLayers);
......
139 139

  
140 140
///////////////////////////////////////////////////////////////////////////////////////////////////
141 141

  
142
  protected ObjectShape getObjectShape(int cubit, int numLayers)
142
  protected ObjectShape getObjectShape(int cubit, int[] numLayers)
143 143
    {
144 144
    int variant = getCubitVariant(cubit,numLayers);
145 145

  
......
245 245

  
246 246
///////////////////////////////////////////////////////////////////////////////////////////////////
247 247

  
248
  protected Static4D getQuat(int cubit, int numLayers)
248
  protected Static4D getQuat(int cubit, int[] numLayers)
249 249
    {
250 250
    if( mQuats     ==null ) initializeQuats();
251 251
    if( mQuatIndex ==null ) mQuatIndex = new int[] { 0,6,1,2,0,4,6,5,0,1,4,9,5,2 };
......
254 254

  
255 255
///////////////////////////////////////////////////////////////////////////////////////////////////
256 256

  
257
  protected int getNumCubitVariants(int numLayers)
257
  protected int getNumCubitVariants(int[] numLayers)
258 258
    {
259 259
    return 3;
260 260
    }
261 261

  
262 262
///////////////////////////////////////////////////////////////////////////////////////////////////
263 263

  
264
  protected int getCubitVariant(int cubit, int numLayers)
264
  protected int getCubitVariant(int cubit, int[] numLayers)
265 265
    {
266 266
    return cubit<4 ? 0 : (cubit<8 ? 1:2);
267 267
    }
268 268

  
269 269
///////////////////////////////////////////////////////////////////////////////////////////////////
270 270

  
271
  protected float[][] getCubitPositions(int numLayers)
271
  protected float[][] getCubitPositions(int[] numLayers)
272 272
    {
273 273
    if( mCenters==null )
274 274
      {
......
298 298

  
299 299
///////////////////////////////////////////////////////////////////////////////////////////////////
300 300

  
301
  protected int getFaceColor(int cubit, int cubitface, int size)
301
  protected int getFaceColor(int cubit, int cubitface, int[] numLayers)
302 302
    {
303 303
    if( mFaceMap==null )
304 304
      {
......
381 381

  
382 382
///////////////////////////////////////////////////////////////////////////////////////////////////
383 383

  
384
  protected float[][] getCuts(int numLayers)
384
  protected float[][] getCuts(int[] numLayers)
385 385
    {
386 386
    if( mCuts==null )
387 387
      {
......
394 394

  
395 395
///////////////////////////////////////////////////////////////////////////////////////////////////
396 396

  
397
  private void getLayerRotatable(int numLayers)
397
  private void getLayerRotatable(int[] numLayers)
398 398
    {
399 399
    if( mLayerRotatable==null )
400 400
      {
401 401
      int numAxis = ROT_AXIS.length;
402
      boolean[] tmp = new boolean[numLayers];
403
      for(int i=0; i<numLayers; i++) tmp[i] = true;
404 402
      mLayerRotatable = new boolean[numAxis][];
405
      for(int i=0; i<numAxis; i++) mLayerRotatable[i] = tmp;
403

  
404
      for(int i=0; i<numAxis; i++)
405
        {
406
        mLayerRotatable[i] = new boolean[numLayers[i]];
407
        for(int j=0; j<numLayers[i]; j++) mLayerRotatable[i][j] = true;
408
        }
406 409
      }
407 410
    }
408 411

  
409 412
///////////////////////////////////////////////////////////////////////////////////////////////////
410 413

  
411
  protected int getNumStickerTypes(int numLayers)
414
  protected int getNumStickerTypes(int[] numLayers)
412 415
    {
413 416
    return 3;
414 417
    }
......
434 437
    {
435 438
    if( mMovement==null )
436 439
      {
437
      int numLayers = getNumLayers();
440
      int[] numLayers = getNumLayers();
438 441
      if( mCuts==null ) getCuts(numLayers);
439 442
      getLayerRotatable(numLayers);
440
      mMovement = new Movement12(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_NOT_SPLIT,ENABLED);
443
      mMovement = new Movement12(ROT_AXIS,mCuts,mLayerRotatable,numLayers[0],TYPE_NOT_SPLIT,ENABLED);
441 444
      }
442 445
    return mMovement;
443 446
    }
......
452 455

  
453 456
///////////////////////////////////////////////////////////////////////////////////////////////////
454 457

  
455
  public ObjectType intGetObjectType(int numLayers)
458
  public ObjectType intGetObjectType(int[] numLayers)
456 459
    {
457 460
    return ObjectType.ULTI_2;
458 461
    }
459 462

  
460 463
///////////////////////////////////////////////////////////////////////////////////////////////////
461 464

  
462
  public int getObjectName(int numLayers)
465
  public int getObjectName(int[] numLayers)
463 466
    {
464 467
    return R.string.ulti2;
465 468
    }
466 469

  
467 470
///////////////////////////////////////////////////////////////////////////////////////////////////
468 471

  
469
  public int getInventor(int numLayers)
472
  public int getInventor(int[] numLayers)
470 473
    {
471 474
    return R.string.ulti2_inventor;
472 475
    }
473 476

  
474 477
///////////////////////////////////////////////////////////////////////////////////////////////////
475 478

  
476
  public int getComplexity(int numLayers)
479
  public int getComplexity(int[] numLayers)
477 480
    {
478 481
    return 6;
479 482
    }

Also available in: Unified diff