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/TwistyMirror.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.Movement6;
37
import org.distorted.objectlb.ObjectList;
38
import org.distorted.objectlb.Twisty6;
35 39

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

  
38
class TwistyMirror extends Twisty6
42
public class TwistyMirror extends Twisty6
39 43
{
40 44
  static final Static3D[] ROT_AXIS = new Static3D[]
41 45
         {
......
65 69

  
66 70
///////////////////////////////////////////////////////////////////////////////////////////////////
67 71

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

  
74 78
///////////////////////////////////////////////////////////////////////////////////////////////////
75 79

  
76
  ScrambleState[] getScrambleStates()
80
  protected ScrambleState[] getScrambleStates()
77 81
    {
78 82
    if( mStates==null )
79 83
      {
......
166 170
// we cannot do this the standard, automatic way because there's only 1 color in the FACE_COLORS
167 171
// table and retCubitSolvedStatus() always returns -1,-1 or 0.
168 172

  
169
  int[] getSolvedQuats(int cubit, int numLayers)
173
  protected int[] getSolvedQuats(int cubit, int numLayers)
170 174
    {
171 175
    if( numLayers==3 )
172 176
      {
......
186 190

  
187 191
///////////////////////////////////////////////////////////////////////////////////////////////////
188 192

  
189
  int getFaceColor(int cubit, int cubitface, int numLayers)
193
  protected int getFaceColor(int cubit, int cubitface, int numLayers)
190 194
    {
191 195
    if( numLayers==2 )
192 196
      {
......
436 440

  
437 441
///////////////////////////////////////////////////////////////////////////////////////////////////
438 442

  
439
  ObjectSticker retSticker(int face)
443
  protected ObjectSticker retSticker(int face)
440 444
    {
441 445
    if( mStickers==null )
442 446
      {
......
458 462

  
459 463
///////////////////////////////////////////////////////////////////////////////////////////////////
460 464

  
461
  int getNumStickerTypes(int numLayers)
465
  protected int getNumStickerTypes(int numLayers)
462 466
    {
463 467
    return numLayers==2 ? 12 : 25;
464 468
    }
......
472 476

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

  
475
  ObjectShape getObjectShape(int cubit, int numLayers)
479
  protected ObjectShape getObjectShape(int cubit, int numLayers)
476 480
    {
477 481
    int extraI, extraV, num;
478 482
    float height;
......
530 534

  
531 535
///////////////////////////////////////////////////////////////////////////////////////////////////
532 536

  
533
  Static4D getQuat(int cubit, int numLayers)
537
  protected Static4D getQuat(int cubit, int numLayers)
534 538
    {
535 539
    if( mQuats ==null ) initializeQuats();
536 540
    return mQuats[0];
......
538 542

  
539 543
///////////////////////////////////////////////////////////////////////////////////////////////////
540 544

  
541
  int getNumCubitVariants(int numLayers)
545
  protected int getNumCubitVariants(int numLayers)
542 546
    {
543 547
    return 6*numLayers*numLayers - 12*numLayers + 8;
544 548
    }
545 549

  
546 550
///////////////////////////////////////////////////////////////////////////////////////////////////
547 551

  
548
  int getCubitVariant(int cubit, int numLayers)
552
  protected int getCubitVariant(int cubit, int numLayers)
549 553
    {
550 554
    return cubit;
551 555
    }
......
559 563

  
560 564
///////////////////////////////////////////////////////////////////////////////////////////////////
561 565

  
562
  float[][] getCubitPositions(int numLayers)
566
  protected float[][] getCubitPositions(int numLayers)
563 567
    {
564 568
    if( mPositions==null )
565 569
      {
......
583 587

  
584 588
///////////////////////////////////////////////////////////////////////////////////////////////////
585 589

  
586
  Static4D[] getQuats()
590
  protected Static4D[] getQuats()
587 591
    {
588 592
    if( mQuats ==null ) initializeQuats();
589 593
    return mQuats;
......
598 602

  
599 603
///////////////////////////////////////////////////////////////////////////////////////////////////
600 604

  
601
  float[][] getCuts(int numLayers)
605
  protected float[][] getCuts(int numLayers)
602 606
    {
603 607
    if( mCuts==null )
604 608
      {
......
632 636

  
633 637
///////////////////////////////////////////////////////////////////////////////////////////////////
634 638

  
635
  int getSolvedFunctionIndex()
639
  protected int getSolvedFunctionIndex()
636 640
    {
637 641
    return 0;
638 642
    }
639 643

  
640 644
///////////////////////////////////////////////////////////////////////////////////////////////////
641 645

  
642
  int getNumCubitFaces()
646
  protected int getNumCubitFaces()
643 647
    {
644 648
    return 6;
645 649
    }

Also available in: Unified diff