Project

General

Profile

« Previous | Next » 

Revision bdbbb4c5

Added by Leszek Koltunski over 2 years ago

Refactoring: split the 'objects' package into two, 'objects' and 'objectlib'.
The point: we're going to need to move the 'objectlib' stuff into its own library module, and that's because we're going to create a new app module which needs access to it.

View differences:

src/main/java/org/distorted/objects/TwistyDiamond.java
19 19

  
20 20
package org.distorted.objects;
21 21

  
22
import static org.distorted.objects.Movement.TYPE_NOT_SPLIT;
22
import static org.distorted.objectlb.Movement.TYPE_NOT_SPLIT;
23 23

  
24 24
import android.content.res.Resources;
25 25

  
26
import org.distorted.helpers.ObjectShape;
27
import org.distorted.helpers.ObjectSticker;
28
import org.distorted.helpers.ScrambleState;
26
import org.distorted.objectlb.ObjectShape;
27
import org.distorted.objectlb.ObjectSticker;
28
import org.distorted.objectlb.ScrambleState;
29 29
import org.distorted.library.main.DistortedEffects;
30 30
import org.distorted.library.main.DistortedTexture;
31 31
import org.distorted.library.mesh.MeshSquare;
32 32
import org.distorted.library.type.Static3D;
33 33
import org.distorted.library.type.Static4D;
34 34
import org.distorted.main.R;
35
import org.distorted.objectlb.Movement;
36
import org.distorted.objectlb.Movement8;
37
import org.distorted.objectlb.ObjectList;
38
import org.distorted.objectlb.Twisty8;
35 39

  
36 40
///////////////////////////////////////////////////////////////////////////////////////////////////
37 41

  
......
63 67

  
64 68
///////////////////////////////////////////////////////////////////////////////////////////////////
65 69

  
66
  TwistyDiamond(int size, Static4D quat, DistortedTexture texture,
67
                MeshSquare mesh, DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
70
  public TwistyDiamond(int size, Static4D quat, DistortedTexture texture, MeshSquare mesh,
71
                       DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
68 72
    {
69 73
    super(size, size, quat, texture, mesh, effects, moves, ObjectList.DIAM, res, scrWidth);
70 74
    }
71 75

  
72 76
///////////////////////////////////////////////////////////////////////////////////////////////////
73 77

  
74
  ScrambleState[] getScrambleStates()
78
  protected ScrambleState[] getScrambleStates()
75 79
    {
76 80
    if( mStates==null )
77 81
      {
......
118 122

  
119 123
///////////////////////////////////////////////////////////////////////////////////////////////////
120 124

  
121
  int[] getSolvedQuats(int cubit, int numLayers)
125
  protected int[] getSolvedQuats(int cubit, int numLayers)
122 126
    {
123 127
    if( mQuats==null ) initializeQuats();
124 128
    if( mFaceMap==null ) mFaceMap = new int[] {4,0,6,2,7,3,5,1};
......
128 132

  
129 133
///////////////////////////////////////////////////////////////////////////////////////////////////
130 134

  
131
  Static4D[] getQuats()
135
  protected Static4D[] getQuats()
132 136
    {
133 137
    if( mQuats==null ) initializeQuats();
134 138
    return mQuats;
......
136 140

  
137 141
///////////////////////////////////////////////////////////////////////////////////////////////////
138 142

  
139
  int getSolvedFunctionIndex()
143
  protected int getSolvedFunctionIndex()
140 144
    {
141 145
    return 0;
142 146
    }
143 147

  
144 148
///////////////////////////////////////////////////////////////////////////////////////////////////
145 149

  
146
  int getNumStickerTypes(int numLayers)
150
  protected int getNumStickerTypes(int numLayers)
147 151
    {
148 152
    return 1;
149 153
    }
150 154

  
151 155
///////////////////////////////////////////////////////////////////////////////////////////////////
152 156

  
153
  float[][] getCuts(int numLayers)
157
  protected float[][] getCuts(int numLayers)
154 158
    {
155 159
    if( numLayers<2 ) return null;
156 160

  
......
188 192

  
189 193
///////////////////////////////////////////////////////////////////////////////////////////////////
190 194

  
191
  int getNumCubitFaces()
195
  protected int getNumCubitFaces()
192 196
    {
193 197
    return 8;
194 198
    }
......
302 306

  
303 307
///////////////////////////////////////////////////////////////////////////////////////////////////
304 308

  
305
  float[][] getCubitPositions(int layers)
309
  protected float[][] getCubitPositions(int layers)
306 310
    {
307 311
    int numO = getNumOctahedrons(layers);
308 312
    int numT = getNumTetrahedrons(layers);
......
349 353

  
350 354
///////////////////////////////////////////////////////////////////////////////////////////////////
351 355

  
352
  ObjectShape getObjectShape(int cubit, int numLayers)
356
  protected ObjectShape getObjectShape(int cubit, int numLayers)
353 357
    {
354 358
    int variant = getCubitVariant(cubit,numLayers);
355 359
    int N = numLayers>3 ? 5:6;
......
403 407

  
404 408
///////////////////////////////////////////////////////////////////////////////////////////////////
405 409

  
406
  Static4D getQuat(int cubit, int numLayers)
410
  protected Static4D getQuat(int cubit, int numLayers)
407 411
    {
408 412
    if( mQuats==null ) initializeQuats();
409 413
    int numO = getNumOctahedrons(numLayers);
......
427 431

  
428 432
///////////////////////////////////////////////////////////////////////////////////////////////////
429 433

  
430
  int getNumCubitVariants(int numLayers)
434
  protected int getNumCubitVariants(int numLayers)
431 435
    {
432 436
    return 2;
433 437
    }
434 438

  
435 439
///////////////////////////////////////////////////////////////////////////////////////////////////
436 440

  
437
  int getCubitVariant(int cubit, int numLayers)
441
  protected int getCubitVariant(int cubit, int numLayers)
438 442
    {
439 443
    return cubit<getNumOctahedrons(numLayers) ? 0 : 1;
440 444
    }
441 445

  
442 446
///////////////////////////////////////////////////////////////////////////////////////////////////
443 447

  
444
  int getFaceColor(int cubit, int cubitface, int size)
448
  protected int getFaceColor(int cubit, int cubitface, int size)
445 449
    {
446 450
    int numO = getNumOctahedrons(size);
447 451

  
......
462 466
        case 7: axis = 0; layer =             1; break;
463 467
        }
464 468

  
465
      return CUBITS[cubit].mRotationRow[axis] == layer ? cubitface : NUM_TEXTURES;
469
      return CUBITS[cubit].getRotRow(axis) == layer ? cubitface : NUM_TEXTURES;
466 470
      }
467 471
    else
468 472
      {
......
472 476

  
473 477
///////////////////////////////////////////////////////////////////////////////////////////////////
474 478

  
475
  ObjectSticker retSticker(int face)
479
  protected ObjectSticker retSticker(int face)
476 480
    {
477 481
    if( mStickers==null )
478 482
      {

Also available in: Unified diff