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/TwistyUltimate.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.Movement12;
37
import org.distorted.objectlb.ObjectList;
38
import org.distorted.objectlb.Twisty12;
35 39

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

  
38
class TwistyUltimate extends Twisty12
42
public class TwistyUltimate extends Twisty12
39 43
{
40 44
  private static final float A = (float)Math.sqrt(21*SQ5+47);
41 45
  private static final float B = SQ6*(5*SQ5+11)/(6*A);
......
71 75

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

  
74
  TwistyUltimate(int size, Static4D quat, DistortedTexture texture,
75
                 MeshSquare mesh, DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
78
  public TwistyUltimate(int size, Static4D quat, DistortedTexture texture, MeshSquare mesh,
79
                        DistortedEffects effects, int[][] moves, Resources res, int scrWidth)
76 80
    {
77 81
    super(size, size, quat, texture, mesh, effects, moves, ObjectList.ULTI, res, scrWidth);
78 82
    }
79 83

  
80 84
///////////////////////////////////////////////////////////////////////////////////////////////////
81 85

  
82
  ScrambleState[] getScrambleStates()
86
  protected ScrambleState[] getScrambleStates()
83 87
    {
84 88
    if( mStates==null )
85 89
      {
......
117 121

  
118 122
///////////////////////////////////////////////////////////////////////////////////////////////////
119 123

  
120
  int[] getSolvedQuats(int cubit, int numLayers)
124
  protected int[] getSolvedQuats(int cubit, int numLayers)
121 125
    {
122 126
    if( mQuats==null ) initializeQuats();
123 127
    int status = retCubitSolvedStatus(cubit,numLayers);
......
126 130

  
127 131
///////////////////////////////////////////////////////////////////////////////////////////////////
128 132

  
129
  ObjectShape getObjectShape(int cubit, int numLayers)
133
  protected ObjectShape getObjectShape(int cubit, int numLayers)
130 134
    {
131 135
    int variant = getCubitVariant(cubit,numLayers);
132 136

  
......
232 236

  
233 237
///////////////////////////////////////////////////////////////////////////////////////////////////
234 238

  
235
  Static4D getQuat(int cubit, int numLayers)
239
  protected Static4D getQuat(int cubit, int numLayers)
236 240
    {
237 241
    if( mQuats     ==null ) initializeQuats();
238 242
    if( mQuatIndex ==null ) mQuatIndex = new int[] { 0,6,1,2,0,4,6,5,0,1,4,9,5,2 };
......
241 245

  
242 246
///////////////////////////////////////////////////////////////////////////////////////////////////
243 247

  
244
  int getNumCubitVariants(int numLayers)
248
  protected int getNumCubitVariants(int numLayers)
245 249
    {
246 250
    return 3;
247 251
    }
248 252

  
249 253
///////////////////////////////////////////////////////////////////////////////////////////////////
250 254

  
251
  int getCubitVariant(int cubit, int numLayers)
255
  protected int getCubitVariant(int cubit, int numLayers)
252 256
    {
253 257
    return cubit<4 ? 0 : (cubit<8 ? 1:2);
254 258
    }
255 259

  
256 260
///////////////////////////////////////////////////////////////////////////////////////////////////
257 261

  
258
  float[][] getCubitPositions(int numLayers)
262
  protected float[][] getCubitPositions(int numLayers)
259 263
    {
260 264
    if( mCenters==null )
261 265
      {
......
285 289

  
286 290
///////////////////////////////////////////////////////////////////////////////////////////////////
287 291

  
288
  int getFaceColor(int cubit, int cubitface, int size)
292
  protected int getFaceColor(int cubit, int cubitface, int size)
289 293
    {
290 294
    if( mFaceMap==null )
291 295
      {
......
315 319

  
316 320
///////////////////////////////////////////////////////////////////////////////////////////////////
317 321

  
318
  ObjectSticker retSticker(int face)
322
  protected ObjectSticker retSticker(int face)
319 323
    {
320 324
    if( mStickers==null )
321 325
      {
......
345 349

  
346 350
///////////////////////////////////////////////////////////////////////////////////////////////////
347 351

  
348
  Static4D[] getQuats()
352
  protected Static4D[] getQuats()
349 353
    {
350 354
    if( mQuats==null ) initializeQuats();
351 355
    return mQuats;
......
353 357

  
354 358
///////////////////////////////////////////////////////////////////////////////////////////////////
355 359

  
356
  int getSolvedFunctionIndex()
360
  protected int getSolvedFunctionIndex()
357 361
    {
358 362
    return 0;
359 363
    }
360 364

  
361 365
///////////////////////////////////////////////////////////////////////////////////////////////////
362 366

  
363
  float[][] getCuts(int numLayers)
367
  protected float[][] getCuts(int numLayers)
364 368
    {
365 369
    if( mCuts==null )
366 370
      {
......
387 391

  
388 392
///////////////////////////////////////////////////////////////////////////////////////////////////
389 393

  
390
  int getNumStickerTypes(int numLayers)
394
  protected int getNumStickerTypes(int numLayers)
391 395
    {
392 396
    return 3;
393 397
    }
394 398

  
395 399
///////////////////////////////////////////////////////////////////////////////////////////////////
396 400

  
397
  int getNumCubitFaces()
401
  protected int getNumCubitFaces()
398 402
    {
399 403
    return 8;
400 404
    }

Also available in: Unified diff