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/TwistyRedi.java
73 73

  
74 74
///////////////////////////////////////////////////////////////////////////////////////////////////
75 75

  
76
  public TwistyRedi(int size, Static4D quat, Static3D move, DistortedTexture texture,
76
  public TwistyRedi(int[] numL, Static4D quat, Static3D move, DistortedTexture texture,
77 77
                    MeshSquare mesh, DistortedEffects effects, Resources res, int scrWidth)
78 78
    {
79
    super(size, size, quat, move, texture, mesh, effects, res, scrWidth);
79
    super(numL, numL[0], quat, move, texture, mesh, effects, res, scrWidth);
80 80
    }
81 81

  
82 82
///////////////////////////////////////////////////////////////////////////////////////////////////
......
104 104

  
105 105
///////////////////////////////////////////////////////////////////////////////////////////////////
106 106

  
107
  protected int getResource(int numLayers)
107
  protected int getResource(int[] numLayers)
108 108
    {
109 109
    return R.raw.redi;
110 110
    }
......
133 133

  
134 134
///////////////////////////////////////////////////////////////////////////////////////////////////
135 135

  
136
  protected int[] getSolvedQuats(int cubit, int numLayers)
136
  protected int[] getSolvedQuats(int cubit, int[] numLayers)
137 137
    {
138 138
    if( mQuats==null ) initializeQuats();
139 139
    int status = retCubitSolvedStatus(cubit,numLayers);
......
157 157

  
158 158
///////////////////////////////////////////////////////////////////////////////////////////////////
159 159

  
160
  protected int getNumStickerTypes(int numLayers)
160
  protected int getNumStickerTypes(int[] numLayers)
161 161
    {
162 162
    return 2;
163 163
    }
164 164

  
165 165
///////////////////////////////////////////////////////////////////////////////////////////////////
166 166

  
167
  protected float[][] getCuts(int size)
167
  protected float[][] getCuts(int[] numLayers)
168 168
    {
169 169
    if( mCuts==null )
170 170
      {
......
178 178

  
179 179
///////////////////////////////////////////////////////////////////////////////////////////////////
180 180

  
181
  private void getLayerRotatable(int numLayers)
181
  private void getLayerRotatable(int[] numLayers)
182 182
    {
183 183
    if( mLayerRotatable==null )
184 184
      {
......
198 198

  
199 199
///////////////////////////////////////////////////////////////////////////////////////////////////
200 200

  
201
  protected float[][] getCubitPositions(int size)
201
  protected float[][] getCubitPositions(int[] numLayers)
202 202
    {
203 203
    if( mCenters==null )
204 204
      {
......
236 236

  
237 237
///////////////////////////////////////////////////////////////////////////////////////////////////
238 238

  
239
  protected ObjectShape getObjectShape(int cubit, int numLayers)
239
  protected ObjectShape getObjectShape(int cubit, int[] numLayers)
240 240
    {
241 241
    int variant = getCubitVariant(cubit,numLayers);
242 242

  
......
312 312

  
313 313
///////////////////////////////////////////////////////////////////////////////////////////////////
314 314

  
315
  protected Static4D getQuat(int cubit, int numLayers)
315
  protected Static4D getQuat(int cubit, int[] numLayers)
316 316
    {
317 317
    if( mQuats==null ) initializeQuats();
318 318

  
......
346 346

  
347 347
///////////////////////////////////////////////////////////////////////////////////////////////////
348 348

  
349
  protected int getNumCubitVariants(int numLayers)
349
  protected int getNumCubitVariants(int[] numLayers)
350 350
    {
351 351
    return 2;
352 352
    }
353 353

  
354 354
///////////////////////////////////////////////////////////////////////////////////////////////////
355 355

  
356
  protected int getCubitVariant(int cubit, int numLayers)
356
  protected int getCubitVariant(int cubit, int[] numLayers)
357 357
    {
358 358
    return cubit<8 ? 0:1;
359 359
    }
360 360

  
361 361
///////////////////////////////////////////////////////////////////////////////////////////////////
362 362

  
363
  protected int getFaceColor(int cubit, int cubitface, int size)
363
  protected int getFaceColor(int cubit, int cubitface, int[] numLayers)
364 364
    {
365 365
    if( mFaceMap==null )
366 366
      {
......
445 445
    {
446 446
    if( mMovement==null )
447 447
      {
448
      int numLayers = getNumLayers();
448
      int[] numLayers = getNumLayers();
449 449
      if( mCuts==null ) getCuts(numLayers);
450 450
      getLayerRotatable(numLayers);
451
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,numLayers,TYPE_SPLIT_CORNER,ENABLED);
451
      mMovement = new Movement6(ROT_AXIS,mCuts,mLayerRotatable,numLayers[0],TYPE_SPLIT_CORNER,ENABLED);
452 452
      }
453 453
    return mMovement;
454 454
    }
......
463 463

  
464 464
///////////////////////////////////////////////////////////////////////////////////////////////////
465 465

  
466
  public ObjectType intGetObjectType(int numLayers)
466
  public ObjectType intGetObjectType(int[] numLayers)
467 467
    {
468 468
    return ObjectType.REDI_3;
469 469
    }
470 470

  
471 471
///////////////////////////////////////////////////////////////////////////////////////////////////
472 472

  
473
  public int getObjectName(int numLayers)
473
  public int getObjectName(int[] numLayers)
474 474
    {
475 475
    return R.string.redi2;
476 476
    }
477 477

  
478 478
///////////////////////////////////////////////////////////////////////////////////////////////////
479 479

  
480
  public int getInventor(int numLayers)
480
  public int getInventor(int[] numLayers)
481 481
    {
482 482
    return R.string.redi2_inventor;
483 483
    }
484 484

  
485 485
///////////////////////////////////////////////////////////////////////////////////////////////////
486 486

  
487
  public int getComplexity(int numLayers)
487
  public int getComplexity(int[] numLayers)
488 488
    {
489 489
    return 4;
490 490
    }

Also available in: Unified diff